using layouts in advanced modules, adding a view to the layout
  • Hi i am struggling to get a view to appear in a layout in an advance module. It seems that i can either view the layout or the view but i cant seem to add the view to the layout file in my advanced module i don't want to use the views or layouts in the application folder. Firstly is this possible. an example below. of seeing a view but not one with a layout added from advanced module as this will not work then.

    $vars = array();

    $output = $this->load->module_view('doncaster_transit_centre', 'test', $vars, TRUE);
  • Are you assigning the correct variable for the body content of the layout. By default, the variable "body" is used in the layout to insert the contents of the view file associated with the layout.
  • Yes I am using the default body variable but it won't use the layout template in my module. Is there something else I need to do. Also on a separate subject I'm using the fuel_page class as an extention to my own page class in the advanced module but I can get the darn thing to show in the admin panel under my module name no matter what I try. Sorry for hitting you with several things but spent a whole day trying to get both of these issues working. Followed documentation and tried other ways but still no results.
  • For the first issue, what is the code you are using? For the second issue, I'm not quite sure I understand what you mean by extending the Fuel_page class. Do you have code examples for that too?
  • First issue is the code in first comment with $var['layout'] being set to the module layout template.
    Second issues is a page model in my advanced module which extends the fuel_page class but cantget this to show up in admin panel under my advanced module I just used the same code for the menu as the page option on fuel but modified where it was coming from and the file it was using
  • For first issue, do you have the actual code (you can enclose them in an HTML "code" tag to distinguish it as code in the comment).

    For the second issue, I'll need some code as well. For example, are you uses "pages" as the module name? Also, you may need to add some code in your config file to display the proper navigation as shown in the advanced Blog module:
  • No worries I've now sorted the issues I was having with the menu was posting to wrong class. I've got around the other issue but have discoveed that you can only use a view or layout in advanced modules doesn't seem to allow both. I'm now using the layouts in my application folder and views in my advanced modules.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!