Page 1 of 1

How should I structure custom page layouts? [solved]

Posted: Wed Jan 16, 2013 8:29 am
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.

Re: How should I structure custom page layouts?

Posted: Wed Jan 16, 2013 5:24 pm
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.

Re: How should I structure custom page layouts?

Posted: Wed Jan 16, 2013 10:22 pm
by davids355
Thanks, ill take a look at this tomorrow morning.

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

Posted: Thu Jan 17, 2013 8:26 am
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.

Re: How should I structure custom page layouts?

Posted: Thu Jan 17, 2013 8:51 am
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.

Re: How should I structure custom page layouts?

Posted: Thu Jan 17, 2013 8:59 am
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...?

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

Posted: Sat Jan 19, 2013 6:59 pm
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.