Page 1 of 1

need clarification on content blocks

Posted: Mon Nov 18, 2013 5:26 pm
by turpentyne
I'm trying to solve a couple problems, and ran into something I'm not understanding. Forgive me, if I'm just being dense.

I know there's the basic required {content} tag
And I know the tag, {global_content}

But that leaves me with a third option, I'm not understanding how to set up - or if it's something different: the ability to use the {content tag by adding "block" - like this:

{content block="Sidebar"}

Where do I designate this new content block category, or assign pages to it? Or is this just referring to global_content?

Re: need clarification on content blocks

Posted: Mon Nov 18, 2013 5:28 pm
by calguy1000
You put the additional content blocks in your page template.
Then you assign pages to use that page template.

Re: need clarification on content blocks

Posted: Mon Nov 18, 2013 5:51 pm
by turpentyne
ahhh! ok.. got it figured out.

Out of curiosity, is there a simple way to have content within that extra content block only appear if they're within certain menu sections of the site? Or will it cause problems with that content block?

Re: need clarification on content blocks

Posted: Mon Nov 18, 2013 5:55 pm
by calguy1000
for that, you need logic inside the page template. and probably a third party module (CGSimpleSmarty).

logic something like (paraphrasing)
{if this_page_is_child_of('somesection') or page_alias is 'somesection')}
{content block='otherblock'}
{/if}

Note: the edit area for 'otherblock' will appear in the edit content form of all content pages using that template. regardless of whether they pass the above test or not.... However, on frontend display the test will be used.