Page 1 of 1

Global variables [SOLVED]

Posted: Mon May 05, 2008 11:36 pm
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

Re: Global variables

Posted: Mon May 05, 2008 11:51 pm
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.

Re: Global variables

Posted: Tue May 06, 2008 8:08 am
by eh
Thank you!