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

Error on {config_load 'system_vars.config' section='en' scope='global'} #186

Closed
yourchoice opened this issue Feb 18, 2016 · 2 comments
Closed

Comments

@yourchoice
Copy link

Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "file:...\header.tpl" on line 4 "{config_load 'system_vars.config' section='en' scope='global'}" illegal value ''global'' for "scope" attribute <-- thrown in ...\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 4.

  • header.tpl contain the {config_load 'system_vars.config' section='en' scope='global'}
  • top.tpl include header.tpl
  • index.tpl include top.tpl

How can be resolved this error?

Thank You

@yourchoice
Copy link
Author

Sorry, I found. Works with all bellow cases:

{config_load 'system_vars.config' section='en' scope='root'}
{config_load 'system_vars.config' section='en' scope='tpl_root'}
{config_load 'system_vars.config' section='en' scope='smarty'}

Wich is the optimal? 'tpl_root' ?

@uwetews
Copy link
Contributor

uwetews commented Feb 19, 2016

It depends where the config var shall be know.
{config_load 'system_vars.config' section='en'} Will load the vars into the current template

{config_load 'system_vars.config' section='en' scope='tpl_root'} Will load the vars into the current and all parent templates moving down the {include} stack.

{config_load 'system_vars.config' section='en' scope='smarty'} Will in addition update the vars in the Smarty object.

Read the NEW_FEATURES.txt in the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants