Page 1 of 1

Ability to toggle Global Content Blocks on/off

Posted: Mon Apr 28, 2008 4:30 pm
by jmcgin51
I'm looking for the functionality to be able to use a checkbox or radio button to toggle the display of a GCB.  For example, I could set up a GCB with an announcement, such as "Sorry, our store is closed today due to a family emergency".  I then put this GCB on my homepage.  Somewhere in the admin would be a "GCB Display" page, which would list each GCB title along with a pair of radio buttons.  On button for "Display This GCB: YES" and the other for NO.  This would let any authorized user quickly and easily control which GCBs are displayed, without having to go into the template or page and add/edit/remove GCB tags.

Is there anything in the current CMSMS that would provide similar functionality?  What about anything coming in 2.0?

Thanks

Re: Ability to toggle Global Content Blocks on/off

Posted: Mon Apr 28, 2008 5:44 pm
by calguy1000
Just comment them out

put {* at the front and *} at the end

Re: Ability to toggle Global Content Blocks on/off

Posted: Mon Apr 28, 2008 8:13 pm
by jmcgin51
right, but that means someone has to open each GCB...  I'm looking for something simpler.  I have clients who don't understand "commenting".  I do, but they don't.

In other pages I've hard-coded, I've provided this functionality via a simple checkbox, and I'd like to figure out a way to do it within the CMSMS framework...

I would think this could be done pretty simply as a module, but unfortunately I'm clueless when it comes to modules, and more unfortunately don't have the time to learn right now...

thanks

Re: Ability to toggle Global Content Blocks on/off

Posted: Mon Apr 28, 2008 8:24 pm
by calguy1000
unfortunately, adding the ability to enable/disable GCB's or UDT's would require a database schema change, and significant code changes.

It's probably not feasible at this time.

Maybe use the news module to display a 'motd' category and a limit of 1 article.

Re: Ability to toggle Global Content Blocks on/off

Posted: Mon Apr 28, 2008 8:28 pm
by Nullig
As an interim solution, you could have two identical templates/pages, except for the inclusion of the GCB in one of them. Then the user just has to activate the appropriate one, instead of editing the template/page.

Nullig

Re: Ability to toggle Global Content Blocks on/off

Posted: Mon Apr 28, 2008 8:44 pm
by jmcgin51
that's interesting; hadn't thought of that...

thanks Nullig and Calguy!

Re: Ability to toggle Global Content Blocks on/off

Posted: Mon Apr 11, 2011 10:06 am
by gocreative
I realise this is old, but another solution would be to create a new GCB called something like 'show-announcement' and insert this into the page template. If any value is present, show the other GBS that you want to display on the site, such as 'major-announcement'. And if 'show-announcement' is empty, don't show the other GCBs. That way the user need only edit one GCB in order to show the others.