Search
Other Snippets questions
Forum

Feature request: Global variables

Alex Podtep's Avatar Alex Podtep
It would great to have Global Variables section in addition to per snippet variables. In my case I'm reusing variables across most snippets. Instead of adding same variables to each snippet It would be very helpful to have ability to set all variables in one place (Options) and reuse them across multiple snippets. Needless to say if snippet has its own variable with same name it should ignore global one.

Thanks!
Peter van Westen's Avatar Peter van Westen ADMIN
That would be outside the scope of how Snippets is set up. That would require a separate tag to set those global variables before using any individual snippets.

You could use Sourcerer to set global variables in PHP.
Then in the snippets, use PHP (also through Sourcerer) to output those globals (with optionally some fallback to a default value).
Please post a rating at the Joomla! Extensions Directory
Alex Podtep's Avatar Alex Podtep
Thanks for your replay!
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription