Custom pages

edited December 2013 in Feature Requests
I create a new page while in Fuel from admin side but manually I couldn't create it...
Steps that I followed are:-
1: I create a controller named as hello.php
2:i create the view as hello.php
...but it doesn't work,yaar...
Guide me in steps,please...

Comments

  • edited December 2013
    I also have the same problem.

    In fuel v1.0

    step1: Create a folder to contain my code in the fuel/modules/ my_folder
    step2: Create my config folder and add a {module_name}.php, {module_name}_constants.php, and a {module_name}_routes.php
    step3: Create my controller files as my_controller.php and code follows
    class My_controller extends Fuel_base_controller { function __construct() { parent::__construct(); $this->config->module_load('my_module', 'my_module'); $this->_validate_user('my_module/my_controller'); $this->view_location = 'my_module'; } function index() { $vars['hello'] = 'hello world'; $this->load->view('_admin/my_view', $vars); } }
    step4: create my Views file as my_view.php

    i can see the page, but the page no fuel_header and fuel_footer, Please help me~
  • edited 6:24AM
    raham,

    What does your controller method look like and what was the URI path you were using to access the page?

    im905513,

    The header and footer won't be there because you are simply loading the view file. To have the header and footer from the admin you'll need to use:
    $this->fuel->admin->render('_admin/my_view', $vars)
  • edited December 2013
    thank you very much~
  • edited 6:24AM
    Excuse me,How can i reset admin fuel css?
    because bootstrap css and fuel.min.css conflict
    my css use bootstrap.css
    thanks
  • edited 6:24AM
    Are you wanting to completely replace fuel.min.css or simply overwrite certain rules? If you want to overwrite certain rules, you can use the $config['xtra_css'] configuration parameter in your fuel/application/config/MY_fuel.php file.
    $config['xtra_css'] = 'fuel_overwrites';
    This will include a file from assets/css/fuel_overwrites.css
  • edited 6:24AM
    Sorry...my English is not very good

    1. i want to using bootstrap.css in my customer views,but the fuel.min.css will replace my styles,how can i disable fuel.min.css in my views?

    2. and i put a form into my customer views(i did not use form_builder), but it will remove my form tag, how do i reslove this question?
  • edited 6:24AM
    Happy New Year^^
  • edited 6:24AM
    Happy New Year to you too!

    For the CSS, you can't really remove the fuel.min.css without actually removing it from the fuel/modules/fuel/views/_blocks/fuel_header.php file. If you are looking to overwrite certain styles, I would use the $config['xtra_css'] parameter explained earlier to load in a stylesheet that overwrites the rules you need.

    For the form tag, the CMS fuel/modules/fuel/views/layouts/admin_shell.php layout file has the main form tag in it already however, you can pass variables to your page to change the action and method behaviors. Below is an example of a way you could use it in your controller:
    $vars['form_action'] = $this->module_uri.'/my_page'; $vars['form_method'] = 'get'; $crumbs = array($this->module_uri => $this->module_name); $this->fuel->admin->set_titlebar($crumbs); $this->fuel->admin->render('my_view', $vars);
  • edited 6:24AM
    Thank you for your reply.

    Best wishes
Sign In or Register to comment.