XF 2.2 How to test for a forum in PAGE_CONTAINER

bburton

Member
I'm looking for a quick test to be used in PAGE_CONTAINER to tell me I'm looking at a forum and not some other page.

I tried

<xf:if is="$forum.forum_type_id"> This is a Forum </xf:if>

<xf:if is="$forum.node_id"> This is a Forum </xf:if>

but these don't distinguish between forums and threads. How can I single out forums and not include threads?

Thanks!
 

digitalpoint

Well-known member
$thread isn't "bubbled up" to PAGE_CONTAINER, so that variable isn't available normally to check if you are on a thread page. That being said, if you add this to the forum_macros template (after the line where it does the same thing for forum):
HTML:
<xf:page option="thread" value="{$thread}" />
...that will make $thread variable available in PAGE_CONTAINER.

Then you could have some logic like:
HTML:
<xf:if is="$forum.node_id && !$thread">This is a Forum</xf:if>
 
Top