Resource icon

Free Sub-Forums Grid

This template modification displays the sub-forums below the parent node body.

First step: Ensure the style property nodeListSubDisplay is set to "Listed below node", you can find this in Style properties > Node/forum list

Template node_list_forum

Find this bit of code below and copy it to clipboard then delete it.
HTML:
<xf:if is="$depth == 2 AND property('nodeListSubDisplay') == 'flat'">
            <xf:macro template="forum_list" name="sub_nodes_flat"
                      arg-children="{$children}"
                      arg-childExtras="{$childExtras}"
                      arg-depth="{{ $depth + 1 }}" />
        </xf:if>
Find:
HTML:
</div>

    <xf:if is="{$depth} == 1">
Add above: (Paste the code you copied from the step above)
HTML:
<xf:if is="$depth == 2 AND property('nodeListSubDisplay') == 'flat'">
            <xf:macro template="forum_list" name="sub_nodes_flat"
                      arg-children="{$children}"
                      arg-childExtras="{$childExtras}"
                      arg-depth="{{ $depth + 1 }}" />
        </xf:if>
Template: node_list_category

Find this bit of code below and copy it to clipboard then delete it.
node_list_category:
<xf:if is="$depth == 2 AND property('nodeListSubDisplay') == 'flat'">
            <xf:macro template="forum_list" name="sub_nodes_flat"
                      arg-children="{$children}"
                      arg-childExtras="{$childExtras}"
                      arg-depth="{{ $depth + 1 }}" />
        </xf:if>
Find:
HTML:
</div>
</xf:macro>

<xf:macro name="depthN" arg-node="!" arg-extras="!" arg-children="!" arg-childExtras="!" arg-depth="1">
Add above: (Paste the code you copied from the step above)
HTML:
<xf:if is="$depth == 2 AND property('nodeListSubDisplay') == 'flat'">
            <xf:macro template="forum_list" name="sub_nodes_flat"
                      arg-children="{$children}"
                      arg-childExtras="{$childExtras}"
                      arg-depth="{{ $depth + 1 }}" />
        </xf:if>
Add to extra.less template:
CSS:
<xf:if is="property('nodeListSubDisplay') == 'flat'">
.node-subNodeFlatList {
        background: @xf-paletteColor1;
        border-top: 1px solid @xf-borderColorFaint;
        padding: 10px 25px;
}
.node-subNodeFlatList > li {
        margin-right: 0;
        width: 25%;  /** Change this value to increase the amount of links in each row **/
}

@media (max-width: @xf-responsiveMedium)
{
    .block-body .node
    {
        .node-subNodesFlat
        {
            display: block;
        }
    }
}
@media (max-width: @xf-responsiveNarrow)
{
    .block-body .node
    {
        .node-subNodesFlat
        {
            display: none;
        }
    }
}
</xf:if>
Tác giả
nguyenac
First release
Last update
Bình chọn
0,00 star(s) 0 đánh giá

More resources from nguyenac

Top Bottom