Quick Tempcode Question

Post

Posted
Rating:
#3313 (In Topic #649)
Joe
I'm trying to add some content to the footer of GLOBAL_HTML_WRAP.tpl that I only want to be visible if the user is currently viewing a specified page. Is there some sort of tempcode string I can enclose the content in and only display it if the user is viewing said page?

So for example.

Post

Posted
Rating:
#3314
Joe
Let me elaborate a little, sorry:

I've implemented a site-tutorial system using Javascript. So when the user visits a certain page, the JS function is called and overlays pop up on the screen showing the user what each area of the site does. Problem is, I'm calling this function via the Comcode page I want it to show on, and due to limitations I cannot show overlays beneath the location of where I'm calling the script (currently in a Comcode page). I want to be able to add overlays in the footer to explain to users how to use the features located in these areas.

I can't call the JS function in GLOBAL_HTML_WRAP.tpl because then it will show on every page in every zone - I just want to display this Javascript functionality when a user visits a single page.

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Chris Graham)
#3315
Try something like this:



If you need to also restrict it by zone, then something like this:



Just replace zone_name and comcode_page_name with the name of the zone and page you want to match. 

Note: This was not tested. I think I got the syntax right and all the symbols, brackets, and commas placed correctly. 

Tip: If you aren't sure about what to use for zone_name or comcode_page_name, just put the forum and topicview tempcode symbols somewhere in your comcode page or footer temporarily so you can see what the zone and page names are.

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Jason Verhagen)
#3316
Joe
Jason, you're a genius Sir!

It works wonderfully, thanks!   :thumbs:
2 guests and 0 members have recently viewed this.