Set Wiki table of contents to expanded?

Is there a way to have a Table of Contents widget automatically expanded to a new level? 

For example, when you load one of our wikis, the TOC shows as:

But I'd like to see those first two options (Quick Videos and User Adoption) expanded on initial load:

I don't see any options on the widget settings and looked through the code in Widget Studio (not a developer, but know a few things). The closest I found was on Wikis - Table of Contents > Content, I tried raising the ExpandToLevel setting from 1 to 3, but it didn't seem to help:

#else
	#set($pages = $core_v2_utility.FlattenHierarchy($core_v2_wikiToc.List($wiki.Id), 'Children', "%{ ExpandToLevel=1, HiddenProperty='HiddenInTableOfContents' }"))
#end

I feel like this should be similar to the depth of forum replies, similar to  Remove the indentation in forum replies  . 

Any thoughts? Thanks in advance!

Parents
  • You're very close! The issue is that the #else block you modified is only executed if there is a not a contextual wiki page and the contextual wiki page was loaded from $core_v2_wikiPages.CurrentOrDefault -- so the default page is loaded and the #else block is not used.

    In addition to the change you made, you will need to also change the #if statement related to this #else from:

    #if ($currentPage.Id > 0)

    to

    #if ($currentPage.Id > 0 && $currentPage.Id != $core_v2_wikiPage.Default.Id)

    And note that, like  pointed out, this will affect all wiki table of contents throughout the site on their home pages.

Reply
  • You're very close! The issue is that the #else block you modified is only executed if there is a not a contextual wiki page and the contextual wiki page was loaded from $core_v2_wikiPages.CurrentOrDefault -- so the default page is loaded and the #else block is not used.

    In addition to the change you made, you will need to also change the #if statement related to this #else from:

    #if ($currentPage.Id > 0)

    to

    #if ($currentPage.Id > 0 && $currentPage.Id != $core_v2_wikiPage.Default.Id)

    And note that, like  pointed out, this will affect all wiki table of contents throughout the site on their home pages.

Children