El Forum
07-06-2007, 01:45 PM
[eluser]Xandrios[/eluser]
Hello,
I've just started learning CI. Aside from a few strange issues in the Database cache module things are going smooth. Worked successfully through a couple of tutorials as well. So for practice I decided to setup a small CMS-like website. And this is where I ran into problems.
Say I would like all the application pages to look the same (header, menu, side, footer), only the main content changes. And with for example on every page the weekly poll shown on the side.
Building simple pages works very well, but how would I re-use the header/footer code in a smart way? And more importantly: How would I show the Poll on each page on the side? Off course this could be solved by copying the poll-view to the view of every page, but that is ugly at the least. plus that would mean that I need to implement a database call (Got to find the poll question and choices) in each controller to be able to show the poll properly.
Is there a way to somehow create a module (ie a poll) and 'include' this on every page that I would like it to be on? And the same for header/footer data?
Thank you!
Hello,
I've just started learning CI. Aside from a few strange issues in the Database cache module things are going smooth. Worked successfully through a couple of tutorials as well. So for practice I decided to setup a small CMS-like website. And this is where I ran into problems.
Say I would like all the application pages to look the same (header, menu, side, footer), only the main content changes. And with for example on every page the weekly poll shown on the side.
Building simple pages works very well, but how would I re-use the header/footer code in a smart way? And more importantly: How would I show the Poll on each page on the side? Off course this could be solved by copying the poll-view to the view of every page, but that is ugly at the least. plus that would mean that I need to implement a database call (Got to find the poll question and choices) in each controller to be able to show the poll properly.
Is there a way to somehow create a module (ie a poll) and 'include' this on every page that I would like it to be on? And the same for header/footer data?
Thank you!