• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Table of Contents (TOC)

gldtn

New Member
AMS Premium
CAS Premium
RMS Premium
SC Premium
UBS Premium
Is it currently possible to have the TOC appear collapsed by default on an article category overview page? If not can you move this thread to the suggestion forum?
 
It would be a simple template edit IIRC. I'm pretty sure that I posted a how to at my development site. I'll see if I can find it and post it here.
 
For those of you that want the Table of Contents collapsed by default when first accessing the page, make this simple edit.

Edit Template: nflj_ams_article_sidebar

FIND this block of code:

Code:
    <xen:if is="{$xenOptions.amsSidebarArticleTocPages} AND {$articlePages}">   
        <div class="section">
            <div class="secondaryContent">
                <h3>{xen:phrase nflj_ams_table_of_contents}</h3>

                <span><a href="#" class="JsOnly ToggleTrigger" data-target="#ShowHideSidebarTOC_{$article.article_id}">View {xen:phrase nflj_ams_table_of_contents}</a></span>

                <div id="ShowHideSidebarTOC_{$article.article_id}" class="section avatarList amsArticleTOC" style="display: block;">
                    <ol>
                        <li><a href="{xen:link ams, $article}#article-{$article.article_id}" class="{xen:if '!{$articlePage} && !{$article.isFull}', selected}"><span>{xen:phrase nflj_ams_article_overview}</span></a></li>
                        <xen:foreach loop="$articlePages" key="$articlePageKey" value="$_articlePageNav">
                            <li>{xen:string repeat, '&nbsp; ', $_articlePageNav.depth}<a href="{xen:link ams, $article, 'mp={$_articlePageNav.article_page_id}'}#article-{$article.article_id}" class="{xen:if '{$articlePage.article_page_id} == {$articlePageKey}', selected}"><span>{xen:if {$_articlePageNav.nav_title}, {$_articlePageNav.nav_title}, {$_articlePageNav.title}}</span></a></li>
                        </xen:foreach>
                        <li><a href="{xen:link ams, $article, 'full=1'}#article-{$article.article_id}" class="{xen:if '{$article.isFull}', selected}"><span>{xen:phrase nflj_ams_view_full_article}</span></a></li>
                    </ol>
                </div>
            </div>   
        </div>   
    </xen:if>


REPLACE with this block of code:

Code:
    <xen:if is="{$xenOptions.amsSidebarArticleTocPages} AND {$articlePages}">
        <div class="section">
            <div class="secondaryContent">
                <h3>{xen:phrase nflj_ams_table_of_contents}</h3>

                <span><a href="#" class="JsOnly ToggleTrigger" data-target="#ShowHideSidebarTOC_{$article.article_id}">View {xen:phrase nflj_ams_table_of_contents}</a></span>

                <div id="ShowHideSidebarTOC_{$article.article_id}" class="section avatarList amsArticleTOC" style="display: none;">
                    <ol>
                        <li><a href="{xen:link ams, $article}#article-{$article.article_id}" class="{xen:if '!{$articlePage} && !{$article.isFull}', selected}"><span>{xen:phrase nflj_ams_article_overview}</span></a></li>
                        <xen:foreach loop="$articlePages" key="$articlePageKey" value="$_articlePageNav">
                            <li>{xen:string repeat, '&nbsp; ', $_articlePageNav.depth}<a href="{xen:link ams, $article, 'mp={$_articlePageNav.article_page_id}'}#article-{$article.article_id}" class="{xen:if '{$articlePage.article_page_id} == {$articlePageKey}', selected}"><span>{xen:if {$_articlePageNav.nav_title}, {$_articlePageNav.nav_title}, {$_articlePageNav.title}}</span></a></li>
                        </xen:foreach>
                        <li><a href="{xen:link ams, $article, 'full=1'}#article-{$article.article_id}" class="{xen:if '{$article.isFull}', selected}"><span>{xen:phrase nflj_ams_view_full_article}</span></a></li>
                    </ol>
                </div>
            </div>
        </div>
    </xen:if>
 
Hmm this did not work.. nothing changed for me. I tried using the Template Modification and did not find anything, so I tried manually, but it did not work .. maybe something minor has changed on newer updates?
 
Are you positive you edited the correct STYLE?

This div now has a INITIAL forced style property of "display: none" so I don't know HOW it is displaying when its forced NOT to.

Code:
<div id="ShowHideSidebarTOC_{$article.article_id}" class="section avatarList amsArticleTOC" style="display: none;">

The CODE I posted was the ORIGINAL code from the first release of AMS when the Block was collapsed by default.
 
Its working fine here, so hopefully its just that you edited a template in a different style than the one you are viewing on the frontend.

You can see it here: Tips & Tricks & How To's

Loads collapsed by default....

Selection_453.png


Expands when you click on "View Table of Contents" (and can be contracted again).

Selection_454.png
 
It did work, sorry for the confusion.. when I created the thread I was talking about the TOC on the actual article section because I did not know about the sidebar block.. but this works just as good. Thank you very much for the fast support!
 
  • Like
Reactions: Bob
Back
Top