Global variables [SOLVED]

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
eh
Forum Members
Forum Members
Posts: 29
Joined: Sun Oct 07, 2007 1:19 pm

Global variables [SOLVED]

Post by eh »

Hi
I'd like to set a variable in one page and use it in another page. As far as I know the template variables are accessible only within the page where they are defined.

Can anybody help me with examples or references to existing docs/forum posts for how to do this in global content blocks and in UDT's.

thanks a lot
Ernst
Last edited by eh on Tue May 06, 2008 8:08 am, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Global variables

Post by calguy1000 »

1.  Create a UDT that sets a session variable, and call that from your page template
2.  use {$smarty.session.myvar} inside your page/page template to read the session variable.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
eh
Forum Members
Forum Members
Posts: 29
Joined: Sun Oct 07, 2007 1:19 pm

Re: Global variables

Post by eh »

Thank you!
Post Reply

Return to “CMSMS Core”