Editable Areas vs Content Blocks

Permalink 2 users found helpful
Another couple of questions related to Andrew's tutorial on html/css to C5 theme conversion.

I've seen references to creating separate header.php and footer.php files. Andrew didn't do this in his tutorial and everything seemed to work. He just adds a bit of php code above an element, and it becomes editable. So, how necessary are the header and footer files?

I'm currently working on converting a template but am not sure how to proceed. The basic structure is main content/sidebar all within a larger container/wrapper.

Under a large main image in the main content area, are 3 content teasers linked to other pages. Should I just make those content areas editable with the php code Andrew demonstrated or do I delete them entirely from the theme html and add them in as blocks and format them accordingly?

Also - what's the difference between those editable regions he defines and a block (text block for example)?

Sorry for the confusion as I'm a newbie, and I couldn't find this info within concrete5.org.

Thanks.

 
jordanlev replied on at Permalink Best Answer Reply
jordanlev
Hi.

* Creating separate header.php/footer.php files is just a way to keep your code clean. It is not required but if you have more than 1 template (e.g. "left_sidebar" and "right_sidebar"), it can be helpful to split out the parts that are the same so that if you want to change the header you only have to do it in one file and not in every single template.

* Deciding what portion of the template to swap out with php code is not an exact science -- you need to think in terms of what you want your user to be able to do with the page. In general, you want the overall structure to be fixed in the page type template (so in your example you'd want to keep the larger container/wrapper, and keep whatever divs are defining the content area and the sidebar). But for individual pieces of content inside that larger area you want to put a single piece of php code for each one. If you post the template html or link to it I could take a look and make a recommendation. Or you could download some free themes from the marketplace and see how they were done (most of the free ones were converted from free template sites so you could go find the original to see how it has changed).

* The difference between editable regions (called "areas") and blocks is that the areas are determined by the designer and blocks are determined by end-users. So when you're building the theme, you as the designer decide what general areas of the page should be editable by the user. Then when the user goes to edit their site, they decide what blocks they want to put inside the areas that you've determined for them. In this way, you can lock down the overall layout of the page but allow the user to add as much content as they want within those locked-down areas by adding blocks to them.

Hope that helps!

-Jordan