-
Notifications
You must be signed in to change notification settings - Fork 0
Header and Footer and Menu on every page
[h2]The Goal[/h2]
You have some content - typically a header and footer, perhaps a menu that maybe lives in a div - and you want to present these items on pretty much every page on your site.
The problem is that you don't want to cut-and-paste that code into each of your views - it's a mess to maintain, and it's not a very elegant approach.
[h2]Discussion[/h2]
Broadly speaking there are a handful of approaches to this challenge:
[b]o[/b] Prepare the common view-snippets early on, and display them in one go with the page-specific data using a generic or main view file. [b]o[/b] ... ?
[h2]The approaches[/h2]
[b]o[/b] Header and Footer and Menu on every page - jedd - (summary - a master view, extending with MY_Controller), [b]o[/b] Header and Footer and Menu on every page - BrianDHall - ([i]summary yet to be provided[/i]) [b]o[/b] [url=http://maestric.com/en/doc/php/codeigniter_template] Jérôme Jaglale's take (off-site)[/url] Summary - most simple template library [b]o[/b] Header and Footer and Menu on every page - haloace - include files [b]o[/b] {Your CI login-name goes here}'s take? - summary of your approach goes here - [color=grey]COPY-THIS-LINE-WHEN-ADDING-YOURS[/color]
[i][color=purple][b]Note to would-be contributors[/b] - it'd be just fantastic if you'd spend the time sharing your approaches with the world, but please resist the temptation to provide a link to another site. First, sites come and go, and dead links are a real pain in the proverbial. Second, off-site material doesn't get discovered by searches within the wiki. Third, the world has enough web pages that are 'lists of links' - we don't need to add to the collection. And finally - the whole idea of this collection of Approaches is so that users can see what [b]you[/b] do - so can you please put your name on anything you contribute, so people can PM you if they want to clarify something?[/color][/i]
[b][i][color=grey]Need to automatically insert category/subcategory listing here somehow, later - for the moment I'll handcode in the first couple of links[/color][/i][/b]