[eluser]Otemu[/eluser]
Hi,
You could try such an approach like this:
1. Create generic layouts for each page such as main pages, article pages, etc.
2. Create reusable modules that you can drop and place on any page, header, footer, sidebars, widgets, etc.
3. On the back-end when creating pages give the option to select template to use such as mainpage template, singlepage template and maybe you could give the option to add modules to the page.
4. When user goes to mysite.com/contactus check if the page exists in database and active, load appropriate view such as contactus page, load all data into this view and display selected modules.
Pseudocode:
Controller:
Code:
<?php
class Mainpage extends CI_Controller {
public function home($getPage)
{
......go to model see if page exists
......model returns results
......load view depending on template selected on backend
......all results returned to view
}
}
?>
Generic View for main pages:
Code:
<html>
<head>
<title>....load title from back-end</title>
</head>
<body>
....load header
<div id="webPage">...load page content from back-end</div>
<div id="sideBar">...load modules</div>
.....load footer
</body>
</html>
This way you can easily add pages to the database and the generic view created will handle it, you can also easily change layout depending on template loaded. Of course this not a well detailed explanation but hope it helps you get started.