I found this great link for beginners' templating in Codeigniter:
http://net.tutsplus.com/tutorials/php/an-introduction-to-views-templating-in-codeigniter/
Genuinely, this is the first time I've been able to follow a tutorial on this subject step-by-step and somewhat understand the logic.
However, while it allows me to specify a template (eg. default) it limits me in having to have ALL of the HTML body code in that content view file. I want to split it up as header, main-content, optional sidebar and footer.
Some of my web pages are three-column (with a left-sidebar and right-sidebar), some are two-column (with the same right-sidebar) and some are one-column (no sidebars) - hence my idea was to have 3 corresponding templates - but I would then have to repeat the code for my right-sidebar in many different view files, which will make it more difficult to edit down the line - and ultimately defeat the purpose of having a template system.
Would it be possible to achieve what I want by editing the existing code, or is there another layout/template library someone could recommend to me?
PS. I have thought about the fact that I can just edit the following lines in the library file to achieve a loaded header and footer, but the body code and optional sidebar is my main roadblock as I can't load a sidebar here without it applying to all templates - including a one-column template.
$this->ci->load->view('header_view, $data);
$this->ci->load->view('templates/'.$tpl_view, $data);
$this->ci->load->view('footer_view, $data);