Problems with page rendering

edited June 2013 in Modules
Hi

I created a module inspired by the blog module in the 1.0 version
But when I try to render a view, I just have the text of my view that is shown in the page

At the moment, this is index method of my controller :

$vars['layout'] = 'main';
$vars['title'] = 'Formation;

$this->fuel->pages->render('formation', $vars);

And when I go to my module, I just see 'formation' written

What did I do wrong ?

Ko

Comments

  • edited 2:25AM
    Do you have a main layout setup and if so, what folder is it residing in?
  • edited 2:25AM
    This is my module architecture :
    modules/
    blog/
    formation/
    - config
    - controllers
    - models
    - views
    -- themes
    --- default
    ---- _blocks
    formation.php
    --- _layouts
    formation.php

    Header and footer are in application/views/_blocks
  • edited 2:25AM
    Try passing the "view_module" parameter like so:
    $this->fuel->pages->render('formation', $vars, array('view_module' => 'formation'));
  • edited 2:25AM
    It does the same thing

    I tried to echo the view and render it, but it just display the content of this view and it's not wrapped into the cms
  • edited June 2013
    Layouts need to exist in the application/views/_layouts/ folder. Perhaps you just create an application/views/_layouts/formation.php file and just include the same file. Also, if you are pulling it from the CMS, try adding "render_mode" => "cms" to get it to pull the page from the CMS explicitly:
    $this->fuel->pages->render('formation', $vars, array('render_mode' => 'cms'));
  • edited 2:25AM
    This one doesn't work but I used the _render method form blog_base_controller, I just had to change some config variables and it works !

    However, I actually meet problems with foreign characters in admin interface, it seems like fuel doesn't accepts the french "é à ê" etc. Is there issues for that ?
  • edited 2:25AM
    I've found an issue with one of the versions of MAMP and the iconv library that was installed with it would cause an issue where it would blank out the value completely. Here is a StackExchange that describes the problem and links it to a version of PHP:
    http://stackoverflow.com/questions/8909442/cannot-submit-special-characters-in-codeigniter
  • edited 2:25AM
    Thanks, the problem is now solved.

    I'm ending my project this week, but I still have a bug conerning the styles added to content with CKEditor

    I did a module, where i just can add few styles (bold, italic, underline). When I add a color, it's not saved, same for the size of text, emoticons ...

    I can do it in the pages or blog module, it works perfectly. Do you have ideas about that ?
  • edited 2:25AM
    When you say the styles aren't saved, do you mean the HTML tags for those styles are not saved in the database? Or do you mean they aren't being displayed on the front end (like the HTML is stripped out)?
  • edited 2:25AM
    The html tags and css are not saved in the database. I can preview the content with the editor, everything is ok, but when I use the save button, the css styles are not saved in my module, it works in blog module but not in the module I created
  • edited 2:25AM
    Are you referring to styles applied with the "style" tag attribute? Perhaps try adding the following in your MY_fuel_modules.php file for the formation module:'sanitize_input' => array('template','php'),
Sign In or Register to comment.