Page 1 of 1

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

Posted: Fri Apr 20, 2012 8:20 am
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}

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

Posted: Fri Apr 20, 2012 8:51 am
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?

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

Posted: Fri Apr 20, 2012 9:40 am
by Rolf

Code: Select all

{if $page_alias != 'news'}
{news number="1"}
{/if}

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

Posted: Fri Apr 20, 2012 9:45 am
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! :)