how to create editable page with module?
I'm familier with Codeigniter. When I create normally a page I make a Controller, a model and a view. Now I would like to have a home page where I can edit it's content in the CMS in the page section. Also I would like to have the last three news items. I don't know how to do this with Fuel cms.
Can someone help me with this?
Comments
For the last 3 news items, I would create a simple module that's linked to your news table. If you are using a static view file, you can use the fuel_model function or you could load the model like normal in CI. There's a few resources on the user guide that should be able to help you too (see below):
http://www.getfuelcms.com/user_guide/general/creating-pages
http://www.getfuelcms.com/user_guide/modules/simple
http://www.getfuelcms.com/user_guide/modules/tutorial
http://www.getfuelcms.com/user_guide/helpers/fuel_helper
And when I'm using a dynamic view in the CMS, how can I add the module to the page?
http://www.getfuelcms.com/user_guide/parsing
So I want to have those 2 separate that the client only can change the content of the site.
Is this possible and how will I do this?
I would like to edit the body text in the CMS in the page section. The news is a module what can be edit in the CMS. So the news must me linked to the home page but without having to to this body of page.
<?php $news = fuel_model('news', array('find' => 'all'); foreach($news as $item): ?> ...// html for news items goes here and you can reference the properties like $item->title, $item->content... etc <?php endforeach;?>
Or you can create a block (either static or in the CMS) with similar code in it to render the news items and include it into the layout like so:
<?=fuel_block('news')?>
The block is good for if you may have a news area on another part of the site and you don't want it in the layout.
Thanks.