<xf:if is="$xf.options.forumsDefaultPage != 'forums' OR ($xf.options.indexRoute AND $xf.options.indexRoute != 'forums/')">
	<xf:title>{{ phrase('forum_list') }}</xf:title>
<xf:else />
	<xf:h1>{{ phrase('forum_list') }}</xf:h1>
</xf:if>

<xf:page option="uix_mainTabSets" value="forum" />
<xf:page option="uix_mainTabActive" value="forum_list" />

<xf:macro template="metadata_macros" name="metadata"
	arg-description="{$xf.options.boardDescription}"
	arg-canonicalUrl="{{ link('canonical:' . $selfRoute) }}" />

<xf:wrap template="forum_overview_wrapper">
	<xf:set var="$pageSelected">forums</xf:set>
</xf:wrap>

<xf:widgetpos id="forum_list_sidebar" position="sidebar" />

<xf:widgetpos id="forum_list_above_nodes" />

<div class="uix_nodeList block">
	<xf:macro name="node_list" arg-children="{$nodeTree}" arg-extras="{$nodeExtras}" />
</div>

<xf:widgetpos id="forum_list_below_nodes" />

<xf:head option="rss_forum"><link rel="alternate" type="application/rss+xml" title="{{ phrase('rss_feed_for_x', {'title': $xf.options.boardTitle})|for_attr }}" href="{{ link('forums/index.rss', '-') }}" /></xf:head>

<xf:macro name="node_list_entry" arg-node="!" arg-extras="!" arg-children="!" arg-childExtras="!" arg-depth="1">
	<xf:css src="node_list.less" />
	<xf:set var="$nodeTemplate" value="{{ $node.getNodeTemplateRenderer($depth) }}" />
	<xf:if is="$nodeTemplate.macro">
		<xf:macro template="{$nodeTemplate.template}" name="{$nodeTemplate.macro}"
			arg-node="{$node}"
			arg-extras="{$extras}"
			arg-children="{$children}"
			arg-childExtras="{$childExtras}"
			arg-depth="{$depth}" />
	<xf:elseif is="{$nodeTemplate.template}" />
		<xf:include template="{$nodeTemplate.template}" />
	</xf:if>
</xf:macro>

<xf:macro name="node_list" arg-children="!" arg-extras="!" arg-depth="1">
	<xf:css src="node_list.less" />
	<xf:foreach loop="$children" key="$id" value="$child">
		<xf:macro name="node_list_entry"
			arg-node="{$child.record}" arg-extras="{$extras.{$id}}"
			arg-children="{$child.children}" arg-childExtras="{$extras}"
			arg-depth="{$depth}"
		/>
	</xf:foreach>
</xf:macro>

<xf:macro name="sub_node_list" arg-children="!" arg-childExtras="!" arg-depth="3">
	<xf:if contentcheck="true">
		<ol>
		<xf:contentcheck>
			<xf:macro template="forum_list" name="node_list"
				arg-children="{$children}" arg-extras="{$childExtras}" arg-depth="{{ $depth + 1 }}"
			/>
		</xf:contentcheck>
		</ol>
	</xf:if>
</xf:macro>

<xf:macro name="sub_nodes_flat" arg-children="!" arg-childExtras="!" arg-depth="3">
	<xf:css src="node_list.less" />
	<xf:if contentcheck="true">
		<div class="node-subNodesFlat">
			<span class="node-subNodesLabel">{{ phrase('sub_forums:') }}</span>
			<ol class="node-subNodeFlatList">
			<xf:contentcheck>
				<xf:macro template="forum_list" name="node_list"
					arg-children="{$children}" arg-extras="{$childExtras}" arg-depth="{{ $depth + 1 }}"
				/>
			</xf:contentcheck>
			</ol>
		</div>
	</xf:if>
</xf:macro>

<xf:macro name="sub_nodes_menu" arg-children="!" arg-childExtras="!" arg-depth="3">
	<xf:css src="node_list.less" />
	<xf:if contentcheck="true">
		<div class="node-subNodeMenu">
			<a class="menuTrigger" data-xf-click="menu" role="button" tabindex="0" aria-expanded="false" aria-haspopup="true">
				<span>{{ phrase('sub_forums') }}</span>
				<xf:fa icon="fa-folder" />
			</a>
			<div class="menu" data-menu="menu" aria-hidden="true">
				<div class="menu-content">
					<h4 class="menu-header">{{ phrase('sub_forums') }}</h4>
					<ol class="subNodeMenu">
					<xf:contentcheck>
						<xf:macro template="forum_list" name="node_list"
							arg-children="{$children}" arg-extras="{$childExtras}" arg-depth="{{ $depth + 1 }}"
						/>
					</xf:contentcheck>
					</ol>
				</div>
			</div>
		</div>
	</xf:if>
</xf:macro>