[SOLVED] Show Global Content Block if content block is empty

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
User avatar
DaRichMan
Forum Members
Forum Members
Posts: 64
Joined: Mon Oct 20, 2008 11:31 am

[SOLVED] Show Global Content Block if content block is empty

Post by DaRichMan »

I tried, I searched but with no luck. But I think for the most of tou a simple question (I hope);

In my template I have a content block for sidebar text. But if this block is empty the default has to be a Global Content Block called sidebar.

Tried (Among others);

Code: Select all

{content block="Sidebar" label="Bla bla bla" page_tab="sidebar" default="{global_content name='sidebar'}"}
Last edited by DaRichMan on Mon Jun 17, 2013 7:02 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Show Global Content Block if content block is empty

Post by calguy1000 »

{content block="Sidebar" label="Bla bla bla" page_tab="sidebar" assign='tmp'}
{if $tmp != ''}{$tmp}{else}{global_content name='sidebar'}{/if}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
DaRichMan
Forum Members
Forum Members
Posts: 64
Joined: Mon Oct 20, 2008 11:31 am

Re: Show Global Content Block if content block is empty

Post by DaRichMan »

Super, thanx for your quick reply and help
Post Reply

Return to “CMSMS Core”