Adding content to a series of pages, but not to the template?

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
msboyd

Adding content to a series of pages, but not to the template?

Post by msboyd »

Hi --

I've used this forum quite a bit and found most of my answers without needing to post, so here's my first question (although I'm sure it's been addressed in some fashion in the past).

We are moving over a lot of legacy content into our new CMS Made Simple setup and I'm wondering what to do with menus (and similar items) that are currently set up as server-side includes that need to reside in the main body of the page.  The tricky part is that these are each specific to a very small sub-group of pages; I'd like to use the templates we've created for a much larger group as well as the pages in question, so I didn't see a good way to do it using Global Content Blocks (unless there's a way to call them into the body of the page that I've missed).

Any other suggestions for adding a snippet of code to maybe 50 sub-pages, but not to the template itself?  I would ideally send out a link to the pages, but they are hidden behind our firewall until we launch.

Thanks!
Lisa
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Adding content to a series of pages, but not to the template?

Post by calguy1000 »

1.  Global content blocks can be used either in page content or in page templates, your choice.
2.  One technique I've used before when needing to customize the behaviour for a subset of pages is to
    set a smarty variable in the metadata area of the appropriate pages, and then use that variable in the page template
    to adjust the behaviour of the template.

i.e: put this content into the metadata area of a page:

Code: Select all

{assign var='hidesearch' value=1}
put this content into your page template: to display the search form only if the hidesearch variable does not exist.

Code: Select all

{if !isset($hidesearch)}
   {search}
{/if}
I'm sure you can adapt this technique to do what you need to do.
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.
msboyd

Re: Adding content to a series of pages, but not to the template?

Post by msboyd »

Thanks...that's one option, but I think it's a little beyond the capabilities of the editors I have putting the content in; is there a way to tweak things so that an extra box appears where they are inputting the text?  That might be a little much to ask for, alas!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Adding content to a series of pages, but not to the template?

Post by calguy1000 »

try adding {content block='extrastuff'} into your page template.
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.
msboyd

Re: Adding content to a series of pages, but not to the template?

Post by msboyd »

Thanks for the suggestion -- sorry to be dense, but I tried just putting that into the source on the page, but it does not want to display, so I'm sure I'm missing something; it seems like it will only display if I add it to the template and that's what I've been trying to avoid, perhaps unreasonably.

If I just need to add it to the template (and this is probably a separate question) is there a way to switch the template on a series of pages without opening up each page individually?

Thanks again for your help!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Adding content to a series of pages, but not to the template?

Post by calguy1000 »

No there's currently no way of changing the template on a series of pages, You have to go to each one manually.

However, if you add {content block='whatever'} into your page template, each page will then have an extra (by default empty) text area for entering text.  If it is empty, then it won't effect your page view.  on the few pages that need the extra content, you just enter in the text that is required, and hit submit.  All the other pages won't be effected.

Unless of course your layout has to change for these pages, in which case you will need to:
a) copy your default page template
b) add the {content block='whatever'} are to the copy, adjusting your layout as necessary
c) set each of the desired pages to use this new page template.
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.
msboyd

Re: Adding content to a series of pages, but not to the template?

Post by msboyd »

Thanks again for your help, I think I will indeed need to just give in and change the template.
Locked

Return to “Layout and Design (CSS & HTML)”