1. 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)

Discussion in 'AMS Support' started by gldtn, Jul 16, 2016.

  1. gldtn

    gldtn New Member AMS 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?
     
  2. Bob

    Bob Developer Staff Member

    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.
     
    gldtn likes this.
  3. Bob

    Bob Developer Staff Member

    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>
     
    gldtn likes this.
  4. gldtn

    gldtn New Member AMS Premium RMS Premium SC Premium UBS Premium

    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?
     
  5. Bob

    Bob Developer Staff Member

    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.
     
  6. Bob

    Bob Developer Staff Member

    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
     
    gldtn likes this.
  7. gldtn

    gldtn New Member AMS Premium RMS Premium SC Premium UBS Premium

    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!
     
    Bob likes this.
  8. Bob

    Bob Developer Staff Member

    Ah.. that is supposed to be collapsed by default. Is yours not?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.