Contact Controller/View dwoo template

edited September 2012 in Modules
In my header and footer blocks, I have some javascript in blocks. So, I'm using the {literal} {/literal} to prevent them from being parsed by dwoo. This works fine; however, when I go to the /contact controlller/view example, The {literal}{/literal} doesn't get parsed and it's displayed on the page as a string. I tried using $data['parse_view'] = TRUE; however, it doesn't have any affect.

I also tried:
$output = $this->fuel_page->render();
$output = parse_template_syntax($output);
echo $output;

However this throws an error because my view file has php code in it.

Is there a way to do what I'm trying to achieve?

Comments

  • edited 3:24AM
    This sounds like it's a static view file correct? If so, the parse_view only gets applied to the view being loaded in and not to the header and footer of the layout which is where your "literal" tag is and would explain why it's not being parsed.

    The 1.0 branch has some changes to help better escape javascript so you don't need to have the "literal" tags. Most of the time, you just need to have a space before and after the "{" and "}". You may also try putting that javascript into its own block.
  • edited 3:24AM
    Thanks for the response, it's actually the contact form controller/view example that comes with fuel cms.

    The literal tags are in the header/footer and aren't parsed as you stated.

    I ended up getting around this by doing the following:

    fuel_set_var('layout', '');
    echo fuel_block(array('view'=>'header', 'parse' => TRUE));
    echo fuel_block(array('view'=>'footer', 'parse' => TRUE));

    This allowed me to load in the header/footer and to have them parsed.
Sign In or Register to comment.