How should I structure custom page layouts? [solved]

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
davids355
Power Poster
Power Poster
Posts: 279
Joined: Fri Apr 04, 2008 10:08 am

How should I structure custom page layouts? [solved]

Post by davids355 »

I wasnt sure where to put this question, so I put it in the lounge, if it fits better elsewhere, please move.

I am in the process of redesigning my site, and at the same time I am upgrading CMSMS to latest version, and basically re-doing everything thats not been quite right.

On my live site I have lots of pages/areas on the site where the layout is slightly different - for example, some groups of pages have custom advertising in he sidebar, some groups of pages have a sub navigation menu before the content starts and so on.

The way I have tackled this up until now is by having templates for any custom groups of pages, because of this, I have around 15 templates - a homepage template, a generic subpage template and the remainder for custom areas of the site.

Just wondering if this is the best way to do it, or if I would be better to have conditional statements all in the one template (So it displays certain content depending on page)?

I am really interested in the correct and most efficient way of doing this.

Thanks in advance.
Last edited by davids355 on Sat Jan 19, 2013 7:01 pm, edited 1 time in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: How should I structure custom page layouts?

Post by velden »

Have a look at this article http://www.i-do-this.com/blog/86/Smarty ... ade-Simple

It's about template inheritance with Smarty 3 (included in latest cmsms).

Problem I encountered with that was that every single template in cmsms needs at least the {content} tag. So every inheriting template needs to have it too. CMSMS does not recognize it when you want to use an inherited {content} block.

That said, it has been a few months ago that I checked that behavior. Might already been solved. Or maybe it can be 'solved' another way.
davids355
Power Poster
Power Poster
Posts: 279
Joined: Fri Apr 04, 2008 10:08 am

Re: How should I structure custom page layouts?

Post by davids355 »

Thanks, ill take a look at this tomorrow morning.
davids355
Power Poster
Power Poster
Posts: 279
Joined: Fri Apr 04, 2008 10:08 am

Re: How should I structure custom page layouts? [SOLVED]

Post by davids355 »

Thanks, that was exactly waht I needed, I am going to use the extend template function as you suggested - I think that will be a really good solution for me.

Many thanks

velden wrote:Have a look at this article http://www.i-do-this.com/blog/86/Smarty ... ade-Simple

It's about template inheritance with Smarty 3 (included in latest cmsms).

Problem I encountered with that was that every single template in cmsms needs at least the {content} tag. So every inheriting template needs to have it too. CMSMS does not recognize it when you want to use an inherited {content} block.

That said, it has been a few months ago that I checked that behavior. Might already been solved. Or maybe it can be 'solved' another way.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: How should I structure custom page layouts?

Post by velden »

Great!

If you find a solution for the required {content}-tag in every (sub) template, please post it here. I'm interested in a solution.

Now I create a {content} tag in every (sub)template and ignore the contents of that.
davids355
Power Poster
Power Poster
Posts: 279
Joined: Fri Apr 04, 2008 10:08 am

Re: How should I structure custom page layouts?

Post by davids355 »

velden wrote:Great!

If you find a solution for the required {content}-tag in every (sub) template, please post it here. I'm interested in a solution.

Now I create a {content} tag in every (sub)template and ignore the contents of that.
I see what you mean.
What about putting the content tag in its own "block" with nothing else, then just re declaring that block in every sub template - that way you aren't spilling content twice...?
davids355
Power Poster
Power Poster
Posts: 279
Joined: Fri Apr 04, 2008 10:08 am

Re: How should I structure custom page layouts? [solved]

Post by davids355 »

This worked a treat, thanks.
Regarding the content issue, I didnt have that problem so it must have been solved in the latest release.
Post Reply

Return to “The Lounge”