[solved] {if $page_alias == 'something'}{do nothing....?}

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
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

[solved] {if $page_alias == 'something'}{do nothing....?}

Post by ladyr0gue »

I am trying to figure out if this is possible!

I would like my news summary to appear on every page except for my news page, which has the summary as the main content.
How do I achieve this without doing what I am at the moment which puts a content block which is surplus to requirements on every page (I don't even need it on news page as I have another content block which appears below the news summary or in it's place if it doesn't exist.)

current code

Code: Select all

{if $page_alias == 'news'}
{content block='some content'}
{else}
{news number="1"}
{/if}
Last edited by ladyr0gue on Sun Apr 22, 2012 2:22 pm, edited 1 time in total.
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

Re: how to say {if $page_alias == 'something'}{do nothing...

Post by ladyr0gue »

ooh ooh ooh! just tried

Code: Select all

{if $page_alias == 'news'}
{*}
{else}
{news number="1"}
{/if}
and it seems to work! joy of joys. is this correct?
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: how to say {if $page_alias == 'something'}{do nothing...

Post by Rolf »

Code: Select all

{if $page_alias != 'news'}
{news number="1"}
{/if}
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

Re: how to say {if $page_alias == 'something'}{do nothing...

Post by ladyr0gue »

Rolf wrote:

Code: Select all

{if $page_alias != 'news'}
{news number="1"}
{/if}
Ah thank you Rolf! I would never have worked that out - looks like the opposite of what I want but I can confirm that it works perfectly and is a rather neater solution than mine :)

it's the '!', isn't it - that makes the argument negative... I'm learning something new every day! :)
Post Reply

Return to “CMSMS Core”