Loading view data from CMS/Database

edited March 2013 in Bug Reports
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

  • edited 3:18AM
    The documentation has been improved quite a bit in the 1.0 beta if you are interested:
    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)
  • edited 3:18AM
    Sorry my post isnt complete yet when I accidentally pushed enter button. I have edited my first post :)
  • edited 3:18AM
    I tried using $this->fuel->pagevars->retrieve($this->uri->uri_string())
    but the 'fuel' variable isnt recognized yet
  • edited 3:18AM
    The "fuel" variable is only in 1.0. If you are using FUEL version 1.0, you can use the following from within a controller:
    $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);
  • edited 3:18AM
    Hello, sorry for the late reply.
    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!
Sign In or Register to comment.