Page 1 of 1

[SOLVED] Hide global content block from some pages

Posted: Tue Jul 30, 2013 3:04 pm
by klendino
Hi

I trying to achieve the following.
I my left column I have a global content block that shows on all pages.
Is there a way to show this content block only on specific pages?

Thanks

Re: Hide global content block from some pages

Posted: Tue Jul 30, 2013 3:20 pm
by calguy1000
There are lots of ways.
but the most basic one is:

Code: Select all

{if $page_alias == 'foo' || $page_alias == 'bar'}
{global_content name='my_gcb'}
{/if}

Re: Hide global content block from some pages

Posted: Tue Jul 30, 2013 4:59 pm
by velden
Different templates? Easy to implement after reading http://www.i-do-this.com/blog/86/Smarty ... ade-Simple
and using one of the latest versions of CMSMS.

Other option: (mis)use on of the 'extra page attribute' fields (options tab of 'Edit content' page.
In template:

Code: Select all

{page_attr key='extra1' assign='ex1'}{if $ex1 != 'skipGCB'}{global_content name='my_gcb'}{/if}
In this example you need to type 'skipGCB' (without quotes that is) in the 'extra page attribute 1' field.

If it needs to be more user friendly/fool proof consider using a module like http://dev.cmsmadesimple.org/projects/econtentblocks and add a checkbox.

Re: [SOLVED] Hide global content block from some pages

Posted: Wed Jul 31, 2013 2:09 pm
by klendino
Thanks for the answers.
Went with Calguy's option and that did the trick.