markahesketh / Prestashop-Theme-Boilerplate

A boilerplate 'blank slate' theme for Prestashop
97 stars 28 forks source link

Minor template restructure #9

Closed Evanion closed 12 years ago

Evanion commented 12 years ago

I posted on the presta forums a few weeks back. The topic as about some minor template restructuring in 1.5 I think the changes will fit well with this boilerplate project

Post on presta:

Hello took a look at 1.5 the other day, and I took a look at the new template.

There are some minor tweaks that I would like to recommend. First, move the structure html from header.tpl and footer.tpl to layout.tpl. And then move the left column to the right of the content, >that way the content appears higher up in the HTML code, and it's more SEF that way.

Why move structure to layout.tpl Well, right now, you have tags starting in header, and ending in footer.... That's bad, it means that you can use IDEs built in code >validation and auto complete, and it increases the risk of forgetting to end a tag, or adding an end tag too early. This also >removes the need for having seperate header and footer files, or you can use it to only contain code for the rendered parts of the >header and footer, for more segmented and cleaner code. So the benefit is purely cleaner code.

Left Column I have moved the left column to the right of the content, and then positioned it back to the left side with CSS (position relative). In >order for the important stuff, like ... content too appear earlier in the code structure.

I have made a simple package of my revised default template. The only changes are the once noted here. I have only supplied >the tpl files that are affected by code change.

Any comments on this would be much appreciated.

The topic can be seen here: http://www.prestashop.com/forums/topic/174549-revised-default-template/page__p__857502#entry857502

Other highend frameworks code both sidebars to the right, one example is the warp framwork for WP and Joomla templates (http://yootheme.com).

markahesketh commented 12 years ago

I like the idea of moving everything to the layout.tpl, that makes a lot of sense and I think is a good idea.

Regarding the left sidebar, is it beneficial to have the central content further up in the code? I used to do similar stuff a couple of years ago, but was never certain if it made a difference? I know previously search engines would only partially read the markup but i'm fairly certain this isn't a problem now.

If we use HTML5 and use <aside> tags for example, search engine robots etc should be able to see the central <div> as the main content if its an SEO concern?

Evanion commented 12 years ago

I gues it's more about grouping similar code together now days then a SEO thing. I find the code more easy to read if I have similar elements closer together, I've done it this way for 5 years.. And in blogs etc, you tend to have both sidebars to the right. In the sass branch I have added css markup to move both sidebars left or right at will. all you need to do i add sidebar-(a or/and b)-left, and it will move the sidebars to the left and shift the content right, to move the sidebars right, just remove the class from the bodytag. This could be done with a template configuration module, that way, the admin could reconfigure the template form the backend, and if it was done really smart, the configuration could be set differently for different pages.

I have worked mostly with Joomla, and is used to being able too do more with the template from the backend then prestashop currently allows. But making a module that lets the admin set hide a sidebar/footer etc... and change template styles ... yellow, red, green between for instance categories, time of day, season or the visitors usergroup would add great power to the platform.