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

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
lewishowles
Forum Members
Forum Members
Posts: 52
Joined: Tue Oct 25, 2011 4:45 pm
Location: Lancashire, UK

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

Post 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.
Last edited by lewishowles on Thu Nov 08, 2012 2:01 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: {content} tags specific to a page.

Post 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 ...
lewishowles
Forum Members
Forum Members
Posts: 52
Joined: Tue Oct 25, 2011 4:45 pm
Location: Lancashire, UK

Re: {content} tags specific to a page.

Post 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.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1921
Joined: Mon Jan 29, 2007 4:47 pm

Re: {content} tags specific to a page.

Post 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....
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: {content} tags specific to a page.

Post 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
lewishowles
Forum Members
Forum Members
Posts: 52
Joined: Tue Oct 25, 2011 4:45 pm
Location: Lancashire, UK

Re: {content} tags specific to a page.

Post by lewishowles »

Yeah inheritance seems like the best option. Not quite as neat as I'd like but it looks pretty good.
Post Reply

Return to “Modules/Add-Ons”