"If Section/Page" Like Tag

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
LeeUmm
Forum Members
Forum Members
Posts: 37
Joined: Mon Jan 28, 2008 3:14 am

"If Section/Page" Like Tag

Post 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.
LeeUmm
Forum Members
Forum Members
Posts: 37
Joined: Mon Jan 28, 2008 3:14 am

Re: "If Section/Page" Like Tag

Post by LeeUmm »

Any takers on this? Pretty important to me.

Cheers,
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: "If Section/Page" Like Tag

Post by calguy1000 »

check out the CGSimpleSmarty module.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
LeeUmm
Forum Members
Forum Members
Posts: 37
Joined: Mon Jan 28, 2008 3:14 am

Re: "If Section/Page" Like Tag

Post 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.
Last edited by LeeUmm on Mon Jan 28, 2008 9:58 pm, edited 1 time in total.
Post Reply

Return to “CMSMS Core”