CodeIgniter Forums
CMS like blocks in a main template file - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CMS like blocks in a main template file (/showthread.php?tid=8620)



CMS like blocks in a main template file - El Forum - 05-24-2008

[eluser]Stylec[/eluser]
Hi, I'm trying to port a site to CI and am looking for ways to do the following.

At present i have a site that has the template coded into the index.php file, I then just use include('topnews.php') to show the topposts from the forums where ever i want.

In topnews.php i get the news from the DB and then pass them to a html template file. This then gets displayed on the index.php file like a block on the left or right side.

In CI i am thinking of having it like this-

Use matchbox to add module support. Have a module called news. Then have a controller called news_block that calls the news_block_view but how do i call the news_block from the main template file just like i did with the include.

Maybe the structure as shown.

modules
-news
--controllers
news_block.php
--views
news_block_view.php

views
-themes
--default
theme.php

Thanks for any help.


CMS like blocks in a main template file - El Forum - 06-04-2008

[eluser]heriniaina[/eluser]
Maybe you can check this and contribute

http://code.google.com/p/ci-cms

This is not blaze :-) this is a new cms but the theme is blaze theme.


CMS like blocks in a main template file - El Forum - 06-04-2008

[eluser]wiredesignz[/eluser]
@Stylec: If you need view partials/blocks within modules, why not try Modular Extensions 4.1, it is designed for this purpose.

Good Luck.