• Hey there, surely it is the best plugin out there in the market.

    I like to use it unfolded for each post. But, I am seeing it feels messy for the longer posts.

    So, is there any way to fold it for the posts with too many headings? It stays unfolded but for any post like the above 15 headings, it goes folded!

    Thanks.
    Usman

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author WPJoli

    (@wpjoli)

    Hey,

    Thank you for your nice message.

    At the moment there is not built-in way to make it folded depending on the size of the actual TOC.

    I could add a new filter hook for a next update that would allow to do so.

    In the mean time, the only way that you can achieve this is with some javascript by counting the number of items within the TOC and changing the class ‘joli-unfolded-incontent’ by ‘joli-folded-incontent’ in the div#joli-toc-wrapper.

    Thread Starter ProUsmanHussain

    (@usmhu)

    Yeah, thanks.
    Here it is

    <script>
    	if(document.querySelectorAll("#joli-toc-wrapper ul li").length > 20){
        document.querySelector("#joli-toc-wrapper").classList.remove("joli-unfolded")
          document.querySelector("#joli-toc-wrapper").classList.add("joli-folded")
    }
    </script>
    Plugin Author WPJoli

    (@wpjoli)

    Thank you for sharing your snippet ! ??

    Thread Starter ProUsmanHussain

    (@usmhu)

    Thank you for replying. I have another query.

    My Joli-TOC visibility setting is unfolded, in-content.

    In appearance, it doesn’t matter which buttons I chose to display to fold/unfold the TOC, it doesn’t appear in the content/front-end!?

    Previously, I adjusted visibility to Responsive, in-content. At that time, things were working fine.

    I really like this plugin, now, I am using it on almost my all sites.

    Thanks.
    Usman

    Plugin Author WPJoli

    (@wpjoli)

    Hi ushmu,

    The unfolded, in-content setting does not indeed provide a button to fold. This was design choice to keep things simple. If you really need this, I could add a filter hook in the future to maybe allow this.

    As you mentionned, the Responsive, in-content setting does provide one.

    Anyways, thank you and glad you are enjoying the plugin !

    Thread Starter ProUsmanHussain

    (@usmhu)

    Thank you for letting me know about all this.

    Would be great if you add the option.

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Is there any way to make it folded for some posts?’ is closed to new replies.