Is there a IF function available for hooks?

NDM

Member
Hi there,

I am trying to include a template based on a specific condition. What I basically want to do is checking if the page I am accessing is a custom XF page and if so, then include a template.

In the pagenode_container template is a line which shows the pagenode_container_article content, so this would be a good start to add something. But the problem is that what I want to include is similar to a sidebar, I need to add the code at the very top. So what I need to check is something like IF this is an article, THEN include my template.

This code is what exists in the template


<xen:hook name="pagenode_container_article">
<article>{xen:raw $templateHtml}</article>
</xen:hook>

What I am looking for is something like:


<xen:hook name="pagenode_container_article">
IF THIS IS A PAGE THEN INCLUDE MY CUSTOM TEMPLATE
<article>{xen:raw $templateHtml}</article>
</xen:hook>

Any idea how I could get this done? I think if I just did


<xen:hook name="pagenode_container_article">
<xen:include template="my_template">
</xen:include>
<article>{xen:raw $templateHtml}</article>
</xen:hook>


then it would probably include my template in forum pages too, which is what I do not want. I really just want to include it if the page I am accessing is actually a PAGE.

Thanks
 
Top Bottom