Loading view data from CMS/Database
Hello, I have been using this fuelcms for few days and it looks great, but I'm struggling a bit because of the lack of documentation.
I'm currently developing a very simple website, which contains few standard pages such as 'home', 'about us', 'contact us', 'service' etc.
My 'home' page would contains the summary of content from other pages, such as brief paragraph from 'service' telling what service the company has to offer. So if the 'service' page is consisted of a paragraph with 200 words, the summary in 'home' would show just 50 or so.
Usually to do this I would just load the view from view folder and passed it to my summary function to process it.
i.e.
$text = $this->load->view('view_to_be_processed');
$this->textprocessorclass->process($text);
However, this time I'm trying to access the view which is located in the cms/database, and I have no idea on how to do it.
I tried doing this:
$text = $this->load->module_library(FUEL_FOLDER, 'fuel_page', array('location' => $lang.'_about', 'render_mode' => 'auto'));
but instead it renders the view.
Any insight?
Comments
https://github.com/daylightstudio/FUEL-CMS/tree/1.0
https://github.com/daylightstudio/FUEL-CMS-User-Guide-Module (place in the fuel/modules/ folder and add it to the MY_fuel $config['modules_allowed'] array)
but the 'fuel' variable isnt recognized yet
$params['render_mode'] = 'cms'; $vars['my_title'] = 'This is my title'; // setting TRUE as the last parameter will return it as a string $page = $this->fuel->pages->render('my_page', $vars, $params, TRUE);
I've successfully ported my website from fuel 0.93 to 1.0 and the solution you gave me worked like a charm!
I'll keep exploring fuelcms... and thanks for developing this great product!