More than 1 {content} section on a page

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
memarkiam

More than 1 {content} section on a page

Post by memarkiam »

At the moment it seems to me I can give only assign 1 piece of content to a page.

This could be a central bit of body text, or almost the whole page (within the template).

But what if I want to allocate seperate parts of a page to seperate pieces of content, so that the users can change almost anything they want, but without the risk of messing up the whole page layout?

Hope this is clear.

If you look at a page like: http://www.devcioconsult.co.uk/index.ph ... tate-about

it's quite a simple page, but still, you have the:

nav (which is in the template - OK)
image bar - at the moment I've Included this the overall page content, but it would be very easy for a user to mess up the html behind this. I'd really like to seperate this from the copy below.
Left nav
: again, at the moment this is in the main content tag, but I'd like it in a seperate element
Body text: this is fine
Footer: this is in the template - OK

Is it possible to have multiple {content} tags on a page, and therefore protect the layout, while giving full CMS control to the users?

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

Re: More than 1 {content} section on a page

Post by calguy1000 »

This is a FAQ.  I suggest you look in the wiki, or do a search of the forum.  It's been answered about 2000 times.
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
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: More than 1 {content} section on a page

Post by Dr.CSS »

When you do a default install and look at the site there is a How CMSMS Works section under it is one called Content on that page it explains the use of the {content} tag...

Also in the admin you can go to Extensions » Tags and click content to get Help and info on the tag...

that makes 2001...  ;)
memarkiam

Re: More than 1 {content} section on a page

Post by memarkiam »

Thanks Mark. However, I'm obviously very thick!

I've checked the FAQ's (both basic & developer)
I've chevked the help links you suggested.

Neither seems to answer my query in the least.

This is what it says in Extensions | Tags:
" Installing a tag

From Re: Any Plans for a Master Search Module?

This example uses pisearch:

  1. Put function.pisearch.php in the plugin directory
  2. Put pisearch.tpl to tmp/template
  3. Read the documentation.
  4. Call it in your template "

I have no idea how, if at all, the above relates to what I am trying to do!
I this has been asked so many times, there is clearly a need for a clearer explanation...

Most of the help seemed to refer to inserting external php code, but of course I just want to divide my page into various sections of content, and tag and maintain them independantly.

I guess the idea seems to be something like:

1) Create you own tags, say, {content1}, {content2}, {content3} etc.
2) Insert these content tags into the HTML of your template
3) When you save a new piece of content, somehow tell the app which tag will be used to call it?


Is that right? If I create a new tag, will this show in the 'Content type' drop down of the edit content page?
But then do I give this 'sub content' the same name as other content for the same page? how does the system know this isn't a different page???

Wel, I guess I'll try it and see what happens. But sorry guys, the help is not clear to me at all on this point.

Mark
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: More than 1 {content} section on a page

Post by calguy1000 »

In Extensions->Tags, click on the help link beside content.

As well, I think in Extensions >> Tags, you can click the help link besieds content.  :) :)
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.
memarkiam

Re: More than 1 {content} section on a page

Post by memarkiam »

OK, thanks. I was looking at the Help in Add Content. Very different.

So the answer is simply to insert seperate tags in the template like {content="contentname"}, and then sections with this name willl magically appear in the edit page screen.

Great!

Still think this could be said clearer, and should be a menu option in the documentation.

Thanks,
Mark
memarkiam

Re: More than 1 {content} section on a page

Post by memarkiam »

Sorry, me again.

Well, it sounded great in principle. In practice...

I got my 2 ssections on the edit page screen, but firstly these weren't named, and secondly, on previewing, no content was shown at all.

Don't know why.

Mark
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: More than 1 {content} section on a page

Post by Dr.CSS »

The extras don't show in preview mode, I've no idea why or why they still have that button in there...

When you make {content="contentname"} ,,mine always say {content block="contentname"},,  but if you get more than one textarea edit box good... they should have a name {content="contentname"} should give you Contentname: next to it like Content: for the first one, on the left hand side....
WebGirl

Re: More than 1 {content} section on a page

Post by WebGirl »

Hi there Memarkiam,

I'm relatively new to CMSMS too, so I understand your frustration.

After receiving help [thanks again Mark!!] I added about 5 content blocks to some of my templates, one of which even called up an image, which I was very excited about :D

This is the format I used, including the DIV so I will have control over page placement:


{content block="ArtworkName" oneline="true" wysiwyg="false"}


The oneline="true" simply means instead of a full Content block, I just see a 'one line' text block to type in.

This information comes from the EXTENSIONS / TAGS / Content tag page in each installed CMSMS:
What parameters does it take?

    * (optional)block - Allows you to have more than one content block per page. When multiple content tags are put on a template, that number of edit boxes will be displayed when the page is edited.

      Example:

      {content block="Second Content Block"}

      Now, when you edit a page there will a textarea called "Second Content Block".
    * (optional)wysiwyg (true/false) - If set to false, then a wysiwyg will never be used while editing this block. If true, then it acts as normal. Only works when block parameter is used.
    * (optional)oneline (true/false) - If set to true, then only one edit line will be shown while editing this block. If false, then it acts as normal. Only works when block parameter is used.
Hope this helps!
WebGirl
Last edited by WebGirl on Mon Dec 11, 2006 8:38 pm, edited 1 time in total.
memarkiam

Re: More than 1 {content} section on a page

Post by memarkiam »

Thanks Mark & WebGirl. This makes sense to me now!

Now I just have to put it into practice...

Thanks again.

Mark
memarkiam

Re: More than 1 {content} section on a page

Post by memarkiam »

Well, I've put this into practice...

I'm getting the 2 content blocks showing (and named) in the page edtor.

But there is still an unamed content block in the editor at the top. If I leave it empty, I can't submit the form.

I've checked & re-checked my template, and I'm sure I don't have a stray {content} tag anywhere, so I'm puzzled.

At the moment I'm duplicating content in here from one of the other blocks, but this doesn't feel right.

Any ideas?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: More than 1 {content} section on a page

Post by Dr.CSS »

The very first one should be a default {content} block which will appear whether it is in the template or not, so you should always have one {content} in the template, it should have Content: in the upper left about 1 or 2 lines above it, sort of up and over a little.

The error/warning probably says no content in content...
Locked

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