Forums / General / Override for extension template not working

Override for extension template not working

Author Message

Guy Brun

Tuesday 12 December 2006 6:27:22 am

Hi

I have made an extention foo with a template xxx.tpl. When I go to url: domain.com/foo/xxx the template xxx.tpl works great.

Then I make an override, say for node/view/full.tpl with matchfile xxx.tpl. BUT this is not working. The debug message says Unknown template variable 'resultArray' in namespace.

In extention code I have:

$tpl->setVariable( 'resultArray', $result_array );

# AND

$Result = array();
$Result['content'] =& $tpl->fetch( 'design:xxx.tpl' );

Do I have to define / import the resultArray variable some other way when overriding the template xxx.tpl ? The template works great when using the direct url(domain.com/foo/xxx)

Regards,
Guy Brun

Claudia Kosny

Wednesday 13 December 2006 1:26:38 pm

Hi Guy

If you override node/view/full.tpl with your template xxx.tpl, xxx.tpl gets exactly the same variables as the node/view/full.tpl would have gotten.

You extension calls the xx.tpl and provides the necessary variables for it, but the /node/view/full.tpl is most likely called by some other, ez internal module which does not provide this variable.

Depending on the content of the variable resultArray you might be able to use a template operator to insert this content into an template.

Claudia