Dwoo variable not rendering in custom field

I have a custom field on a layout I created and in that field i'm trying to use a php variable in the dwoo syntax like this
A Collection of Our {$catName} Patterns.

In my view i'm using the fuel_var function and when I view my page, it prints out exactly what I have in the custom field. Why does it not use the php variable?

Comments

  • edited 4:22AM
    How is the $catName variable being set for that layout/page?
  • It's being set in my controller.
  • edited 4:22AM
    How is it being set? Are you doing something like this:
    $page_init = array('location' => 'my_page'); $this->load->module_library(FUEL_FOLDER, 'fuel_page', $page_init); $this->fuel_page->add_variables($vars); $this->fuel_page->render();
  • It is being set through a query like this:

    $vars['catName'] = $this->patterns_access_model->get_category_by_id($categoryId); // use Fuel_page to render so it will grab all opt-in variables and do any necessary parsing $page_init = array('location' => 'patterns', 'render_mode' => 'cms'); $this->load->module_library(FUEL_FOLDER, 'fuel_page', $page_init); $this->fuel_page->add_variables($vars); $this->fuel_page->render();
  • edited 4:22AM
    On line 249 of the fuel/modules/fuel/libraries/Fuel_page.php file, there is a $vars variable that is passed to the Template parsing on line 255. If you do a print_r on the $vars['catName'], does anything show up?
  • Yes it contains my variable value.
  • edited February 2012
    Yes it contains my variable value.
  • Sorry for the duplicate comment.
  • edited 4:22AM
    Hmm... I'm not sure. If it gets to that point and has the proper variable information right before it is sent to the Dwoo parser, I would think it would work. If you echo out the output from line 255 right after, does it still show {$catName}? Also, just to be safe, you may want to clear the fuel/application/cache/dwoo/compiled directory (or you can do that in the admin by clicking the Page Cache link on the left menu)
  • Yes the value is still there after line 255. I'm actually using {$catName} in the "Body" section of the admin and it works fine as well as in the "Page Title" section, but if I put it in a "Heading" section which i've added through my layout, {$catName} is not recognized.
  • edited 4:22AM
    I'm not quite sure why that is happening at the moment... any luck on your end?
  • Not yet, I have one more thing I want to try tonight.
Sign In or Register to comment.