Quick Tempcode Question
Posted
#3318
(In Topic #618)

Standard member

So for example. {+START,IF,{$CURRENT_PAGE} == zone:page} SOME CONTENT HERE {+END}
Posted

Standard member

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.
Posted

Standard member

{+START,IF,{$EQ,{$PAGE},comcode_page_name}} SOME CONTENT HERE {+END}
If you need to also restrict it by zone, then something like this:
{+START,IF,{$AND,{$EQ,{$ZONE},zone_name},{$EQ,{$PAGE},comcode_page_name}}} SOME CONTENT HERE {+END}
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 {$ZONE} and {$PAGE} tempcode symbols somewhere in your comcode page or footer temporarily so you can see what the zone and page names are.
Regards,
Jason
My ocPortal Sites: Holleywood Studio / Tech Fusion Online
My Composr Sites: NEWBotics Labs
Jason
My ocPortal Sites: Holleywood Studio / Tech Fusion Online
My Composr Sites: NEWBotics Labs
Posted

Standard member

It works wonderfully, thanks!

1 guest and 0 members have just viewed this.