Changing content embedded in template from page to page

Does anyone know a way to change the content that is embedded in the WCM template to change depending on the page you are on? 

For example, on the home page I may want to display advertiser information, but on the events page in the same location I may want to display sponsor information.

This was easy to do in eSeries b/c you could just pass a value in the url. Just looking for ideas.

Thanks,

Terry

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Sample Code

 

 

I am sure there are more sophisticated or elaborate ways to do it. I recently got a request to show a different image at the top of certain pages below the primary navigation. You should be able to do something similar with any web-based widget. See sample code below.

Thanks

Joe

 

<%String pathName = Request.ServerVariables["PATH_INFO"]; %>

<%if (pathName.Contains("/LAMP/Registration/")) {%>

 

<img src="/Public/images/LAMP/Registration.jpg" alt="Lamp Registration"/>

 

 

<%} else if (pathName.Contains("/LAMP/Sessions___Workshops")) {%><img src="/Public/images/LAMP/Lamp_Sessions.jpg" alt="Lamp Sessions"/>

<%}else if (pathName.Contains("/LAMP/Networking___Events/")) {%>

 

<img src="/Public/images/LAMP/Networking_Events.jpg" alt="Networking Events"/>

 

 

<%}else if (pathName.Contains("/LAMP/Hotel___Travel/")) {%><img src="/Public/images/LAMP/Hotel_Travel.jpg" alt="Hotel & Travel"/>

<%}else if (pathName.Contains("/LAMP/Resource_Center/")) {%>

 

<img src="/Public/images/LAMP/Resource_Center.jpg" alt="Resource Center"/>

<%} %>