Help required passing a dynamic variable to a User Defined Tag in 1 template
Posted: Sun Mar 30, 2008 3:07 am
Hi everyone. I'm not sure if there is a better way to handle this process... I'll do my best to explain what I am trying to accomplish.
I have one master template which each page in my site uses. Within this template, there is a specific banner image that I would like to have control over by setting its src attribute on a per-page basis. I don't want to make duplicate copies of the master template since nothing more than the src attribute of this one tag will change. Is there a way that I can set some kind of placeholder variable in the master template which can be overwritten on a page-by-page basis? If so, how do I set this and how to I assign this variable from content blocks?
The UDT that I was thinking of placing in the master template would look something like this:
Is there a way to set the variable for page_banner from each content block so that when the template gets evaluated, the proper image is shown? Am I going about this all wrong?
Thanks and sorry if this is rookie stuff.
I have one master template which each page in my site uses. Within this template, there is a specific banner image that I would like to have control over by setting its src attribute on a per-page basis. I don't want to make duplicate copies of the master template since nothing more than the src attribute of this one tag will change. Is there a way that I can set some kind of placeholder variable in the master template which can be overwritten on a page-by-page basis? If so, how do I set this and how to I assign this variable from content blocks?
The UDT that I was thinking of placing in the master template would look something like this:
Code: Select all
{banner src="page_banner"}
Thanks and sorry if this is rookie stuff.