next_prev_topic.naml

<override_macro name="root_dropdown" requires="node_page">
    <n.comment.>Links for the gallery
        <n.prev_topic/>
        <n.next_topic/>
    </n.comment.>
    <img src="/images/gear.png" class="image16" alt="[t]Options[/t]"/>
    <n.page_node.root_post_dropdown/>
</override_macro>




<macro name='prev_topic'>
    <n.page_node.get_app_node.children_list. start="0" length="1000"
    filter="[n.app_topic_filter/]"
    sort="[n.if.app_is_by_priority][then]priority[/then][else]pinned-and-last-node-date[/else][/n.if.app_is_by_priority]" >
        <n.loop.>           
            <n.if.equal value1="[n.current_node.id/]" value2="[n.page_node.id/]">                
                <then>                   
                    <a href="[n.var name='last_url'/]"><img src="/images/left.png" width="20" height="25" align="absmiddle" alt="Prev"/>Prev</a>
                    <n.break/>                  
                </then>  
            </n.if.equal>
            <n.set_var. name='last_url'><n.current_node.url/></n.set_var.>           
        </n.loop.>
    </n.page_node.get_app_node.children_list.>
</macro>

<macro name='next_topic'>
    <n.page_node.get_app_node.children_list. start="0" length="1000"
            filter="[n.app_topic_filter/]"
    sort="[n.if.app_is_by_priority][then]priority[/then][else]pinned-and-last-node-date[/else][/n.if.app_is_by_priority]" >
        <n.loop.>           
            <n.if.equal value1="[n.current_node.id/]" value2="[n.page_node.id/]">                 
                <then>
                    <n.if.next_node>
                        <then>
                            <a href="[n.current_node.url/]">Next<img src="/images/right.png" width="20" height="25" align="absmiddle" alt="Next"/></a>
                            <n.break/>    
                        </then>
                    </n.if.next_node>                         
                </then>  
            </n.if.equal>            
        </n.loop.>
    </n.page_node.get_app_node.children_list.>
</macro>