XF 1.1 $contentTemplate not eval'ed in node_forum_level_2?


Well-known member
Hi guys,

I'm trying to apply some conditionals in 'node_forum_level_2' template:
<xen:if is="{$contentTemplate} == 'forum_list'">
Do some stuff
For some reason, $contentTemplate evals to an empty string. I've put that code just below the line:
<xen:require css="node_forum.css" />
and it printed nothing while viewing the forum home or a specific forum that had sub-forums.
Can you please let me know if it does the same for you?

I'm looking for a solution to validate in 'node_forum_level_2' template if the forum list is viewed.

Jake Bunce

XenForo moderator
Staff member
Requires a code change:


Add the red code:

Rich (BB code):
	public function renderNodeForTree(XenForo_View $view, array $node, array $permissions,
		array $renderedChildren, $level
		$templateLevel = ($level <= 2 ? $level : 'n');

		return $view->createTemplateObject('node_forum_level_' . $templateLevel, array(
			'contentTemplate' => $view->getTemplateName(),
			'level' => $level,
			'forum' => $node,
			'renderedChildren' => $renderedChildren