Title not showing up on page

edited September 2011 in Modules
I'm messing around with creating a page via the opt-in Controller method and I created a file called myHome.php in the views folder and myHome.php in the views/_variables folder. In _variables/myHome.php, I am setting the page title with

$vars['page_title'] = 'My Home | My First FuelCMS Website'; but the title is blank when I load the page myHome.php.

Any ideas?


  • edited 5:51AM
    Hmm... I just tested it locally and it seems to work OK. You are merging the $page_title variable in your pages title tag in the HTML correct?
  • Umm nope i'm not, how would I do that?
  • edited 5:51AM
    If you just installed FUEL, then you most will be using the main layout found in the fuel/application/views/_layouts/ folder. The main layout includes the header block (found in the fuel/application/views/_blocks folder). That block should already contain the code to merge in $page_title variable at the top (maybe using fuel_var('page_title')). Check to make sure that is the case.
  • I had the template set to none so it turns out I wasn't merging the page title in the html. What is the different between what I found in the template <?php echo fuel_var('page_title', '')?> and <?php fuel_var('page_title') ?> ?
  • edited 5:51AM
    the second one won't echo any output so you need to either precede it with echo or use short tags like so <?=fuel_var('page_title')?>.

    The second parameter is a default value if the variable is empty.
Sign In or Register to comment.