Page 1 of 1

[SOLVED] {content} tags specific to a page.

Posted: Thu Oct 25, 2012 2:12 pm
by lewishowles
This might not be the correct forum but it looks like the best match.

There might be a better way of doing this - though I can't think of it and I can't find a post describing the same question.

I regularly use addition content tags for various reasons. One example is this:

Code: Select all

{content block='heading' assign='heading' wysiwyg='false' default='' label='Page Heading - This is the subtitle of the page, in blue' oneline='true'}
Where the heading might have particular classes on it or structure to it and I'd rather not have the client try to figure all that out.

Is there a way to make a {content} block appear only on a specific page? I know I can show or hide the actual {$heading} variable, but the content block itself still appears when editing that page, even if the whole block is inside an {if} statement such as {if $page_alias != 'home'}.

Or, is there a better way to do this?

The same applies when using both the core content tag and the slight variation that AdvancedContent introduced, both using the latest version of CMSMS.

It's not critical but at the moment I have to either explain it or describe it in the box labels.

Re: {content} tags specific to a page.

Posted: Sun Oct 28, 2012 5:57 pm
by Dr.CSS
If it is in the template it will show when editing a page, the system doesn't know the page alias of the page before it is created so ...

Re: {content} tags specific to a page.

Posted: Tue Oct 30, 2012 12:32 pm
by lewishowles
The same applies to pages that already exist and do have an alias.

So the short answer is no at the moment it can't be done.

Re: {content} tags specific to a page.

Posted: Tue Oct 30, 2012 1:25 pm
by Jo Morg
If it is for only a few pages why not a new template with that content block just for those few pages?
Just a thought....

Re: {content} tags specific to a page.

Posted: Tue Oct 30, 2012 8:16 pm
by velden
And have a look at Smarty 3 possibility to use inheritance. Ideal for creating a template based on an orginal. Don't know in which CMSMS version this became possible.

Recently read about is on this blog:
http://www.i-do-this.com/blog/86/Smarty ... ade-Simple

Re: {content} tags specific to a page.

Posted: Thu Nov 08, 2012 2:00 pm
by lewishowles
Yeah inheritance seems like the best option. Not quite as neat as I'd like but it looks pretty good.