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.
How should I structure custom page layouts? [solved]
How should I structure custom page layouts? [solved]
Last edited by davids355 on Sat Jan 19, 2013 7:01 pm, edited 1 time in total.
Re: How should I structure custom page layouts?
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.
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?
Thanks, ill take a look at this tomorrow morning.
Re: How should I structure custom page layouts? [SOLVED]
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
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?
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.
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?
I see what you mean.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.
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]
This worked a treat, thanks.
Regarding the content issue, I didnt have that problem so it must have been solved in the latest release.
Regarding the content issue, I didnt have that problem so it must have been solved in the latest release.