Page 1 of 1

"If Section/Page" Like Tag

Posted: Mon Jan 28, 2008 3:36 am
by LeeUmm
Hello,

I'm interested in a tag/module I can use to check for a specific page, and then display content based on that. It won't always be an image, so the 'section image' tag won't do.

It would be great if it could check for multiple pages at the same time.

So for example:

if section = home,about,contact

display code

I've found the CustomContent module, but I'm new to the smarty language, and have tried to numerous ways, and can't get it working.

If anybody can point in to a tag/module, or give specific code, that would be great.

Re: "If Section/Page" Like Tag

Posted: Mon Jan 28, 2008 8:59 pm
by LeeUmm
Any takers on this? Pretty important to me.

Cheers,

Re: "If Section/Page" Like Tag

Posted: Mon Jan 28, 2008 8:59 pm
by calguy1000
check out the CGSimpleSmarty module.

Re: "If Section/Page" Like Tag

Posted: Mon Jan 28, 2008 9:32 pm
by LeeUmm
Great, thanks for the super quick response.

Little question though, being new to the smarty language.

I'm basically just trying to find specific pages, not parents of children. At least for the most part.

Here is the code I quickly whipped up to test

{$cgsimple->get_parent_alias($page)}

{if $page == "about-us"}
About Us Page Only
{/if}

Works great, except when I view children pages, I get the output of this line {$cgsimple->get_parent_alias($page)}.

Mind sharing example of how to just store the variable to test, without outputting anything?

*Edit* Nevermind, figured it out by using:

{$cgsimple->get_parent_alias('',$page)}

{if $page == "about-us" | $page == "extensions"}
Certain pages only
{/if}

If there is a more efficient way to do multiple pages, feel free to let me know. If not, this works great. Thanks for pointing me in the right direction.