Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions to signup template #4055

Closed
Jimmi08 opened this issue Dec 30, 2019 · 4 comments
Closed

Questions to signup template #4055

Jimmi08 opened this issue Dec 30, 2019 · 4 comments
Labels
type: question An ask about behavior that is not found documented anywhere

Comments

@Jimmi08
Copy link
Contributor

Jimmi08 commented Dec 30, 2019

  1. why is used defined and not isset() for variables? (empty is better choise in fact)
    if(!defined($SIGNUP_BEGIN))

  2. at the end of template is correct template array used:

$SIGNUP_TEMPLATE['start'] = $SIGNUP_BEGIN;
$SIGNUP_TEMPLATE['end'] = $SIGNUP_END;
$SIGNUP_TEMPLATE['body'] = $SIGNUP_BODY;
$SIGNUP_TEMPLATE['extended-user-fields'] = $SIGNUP_EXTENDED_USER_FIELDS;
$SIGNUP_TEMPLATE['coppa']= '';

but inside signup.php are variables used:
$text = $tp->parseTemplate($SIGNUP_BEGIN.$SIGNUP_BODY.$SIGNUP_END, TRUE, $signup_shortcodes);
Couldn't be they changed to new array?

Why do I ask? Thank require_once there is the way how to extend template with another plugin. But it fails with signup page because those variables are hardcoded at the beginning of the file:

$SIGNUP_BEGIN = null;
$SIGNUP_BODY = null;
$SIGNUP_END  = null;
$COPPA_TEMPLATE = null;
$COPPA_FAIL = null;

Thanks

@Deltik Deltik added the type: question An ask about behavior that is not found documented anywhere label Dec 30, 2019
@CaMer0n
Copy link
Member

CaMer0n commented Dec 30, 2019

@Jimmi08 On new themes you can remove $SIGNUP_BEGIN, $SIGNUP_BODY and $SIGNUP_END from the template and place your html code directly into the array, as you would with other templates.

The intended behavior is that old themes/templates that use only $SIGNUP_BEGIN, $SIGNUP_BODY and $SIGNUP_END continue to function, while new templates should use the array format.

Ideally, $SIGNUP_BEGIN, $SIGNUP_BODY and $SIGNUP_END should be removed from the core TEMPLATE to avoid confusion.

@Jimmi08
Copy link
Contributor Author

Jimmi08 commented Dec 30, 2019

@CaMer0n problem is in signup.php, not in templates

  1. last sync e107, bootstrap3 theme, signup looks ok

  2. used core signup template removed $SIGNUP_BODY and content put into $SIGNUP_TEMPLATE['body']
    Form is not displayed.
    The reason is:

$text = $tp->parseTemplate($SIGNUP_BEGIN.$SIGNUP_BODY.$SIGNUP_END, TRUE, $signup_shortcodes);

After changing it to:
$text = $tp->parseTemplate($SIGNUP_BEGIN.$SIGNUP_TEMPLATE['body'].$SIGNUP_END, TRUE, $signup_shortcodes);
it works again.

Those new array templates are not used at all, after loading templates there is missing something like
$SIGNUP_BODY = $SIGNUP_TEMPLATE['body'];
after loading templates.

And this:
$SIGNUP_BODY = null;
breaks old functionality of overriding template variables, so if this is for old themes, they will not work correctly with old plugins. Different issue, just commented here.

@CaMer0n
Copy link
Member

CaMer0n commented Dec 31, 2019

Those new array templates are not used at all, after loading templates there is missing something like
$SIGNUP_BODY = $SIGNUP_TEMPLATE['body'];
after loading templates.

And this:
$SIGNUP_BODY = null;
breaks old functionality of overriding template variables, so if this is for old themes, they will not work correctly with old plugins. Different issue, just commented here.

Thank you @Jimmi08 !! Would you like to make the above changes and submit a pull-request?

@Jimmi08
Copy link
Contributor Author

Jimmi08 commented Dec 31, 2019

@CaMer0n can I change the test of defined in signup template to empty? (isset is not enough, it could be empty string)

CaMer0n added a commit that referenced this issue May 2, 2020
#4055 signup template correct implementation of GDPR shortcode
@Jimmi08 Jimmi08 closed this as completed Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question An ask about behavior that is not found documented anywhere
Projects
None yet
Development

No branches or pull requests

3 participants