[SOLVED] Page alias wildcard in conditional statement in template?
Posted: Mon Jan 25, 2010 12:58 pm
Hi,
I need a bit of help formatting a conditional statement in a template. This query refers to FrontEndUsers and CustomContent, but the actual thing I need help with is about smarty and/or CMSMS.
Basically my site is composed of 5 or 6 sections, which I've set up nicely with tabs using a modified NCleanBlue template. Each section/tab will have its own slightly modified template for slightly different styling (eg. banner graphics, colours etc.).
One of the sections (lets call it 'Stuff') has a sub-section for registered users, which will display custom content once they've logged in via FrontEndUsers.
Now rather than have yet another seperate template just for this sub-section, I thought I could just put a smarty conditional statement in the template as follows:
This works fine for the one page with the alias "stuffmembers", but I will want to setup several pages for members. Rather than set this conditional statement up to explicitly reference the page alias of each page (thereby necessitating having to update the template each time a new Stuff Members page is added), I thought I could do this by setting up each page with an alias that starts "stuffmembers-", and then amend the first line of the code to read:
But that wildcard '*' doesn't work as I thought.
Can anybody be so kind as to suggest a way I can do this (probably very basic) thing, as I can't find any info elsewhere?
Many thanks,
Mark.
I need a bit of help formatting a conditional statement in a template. This query refers to FrontEndUsers and CustomContent, but the actual thing I need help with is about smarty and/or CMSMS.
Basically my site is composed of 5 or 6 sections, which I've set up nicely with tabs using a modified NCleanBlue template. Each section/tab will have its own slightly modified template for slightly different styling (eg. banner graphics, colours etc.).
One of the sections (lets call it 'Stuff') has a sub-section for registered users, which will display custom content once they've logged in via FrontEndUsers.
Now rather than have yet another seperate template just for this sub-section, I thought I could just put a smarty conditional statement in the template as follows:
Code: Select all
{if $page_alias == "stuffmembers"}
{if $ccuser->loggedin()}
{content}
{else}
<p>You need to be registered and signed in to see this content.</p>
{/if}
{else}
{content}
{/if}
Code: Select all
{if $page_alias == "stuffmembers-*"}
Can anybody be so kind as to suggest a way I can do this (probably very basic) thing, as I can't find any info elsewhere?
Many thanks,
Mark.