Site logo

[Resolved] Create Table of Content in Article

Home Forums Support [Resolved] Create Table of Content in Article

Home Forums Support Create Table of Content in Article

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #1879086
    Leonard

    Hi,

    Is there any block or any ways I can create a Table of Content for my article?

    I tried to look around the blocks but I cant see any obvious one.

    I’m not proficient and is still a new user.

    Thank you!

    #1879202
    David
    Staff
    Customer Support

    Hi there,

    its not block based, but this plugin will add a Table of Contents to your Posts:

    https://en-gb.wordpress.org/plugins/easy-table-of-contents/

    #1882055
    Leonard

    ok thank you!

    #1882366
    David
    Staff
    Customer Support

    You’re welcome

    #2043410
    Tobias

    It would be great if I could create a table of content block in Elements, so that it can be reused on every blog post automatically. Just like the Page Hero. Is there not a way to insert the h2’s and h3’s as dynamic content in a block? Shouldn’t this be something we could arrange with dynamic content?

    It would be handy for style consistency, content management and for reducing separate plugins.

    #2043541
    David
    Staff
    Customer Support

    Hi there,

    ToC plugins ‘scrape’ the_content to find all the Headings, store them in array for later display as bunch of links, and then filter the post content to inject the relevant HTML Anchors for each of the heading links. A lot of this relies on filter hooks and/or Javascript to do this. And theres a lot of things to consider here such as Accessibility.

    All of which is completely outside of what Block Elements Dynamic Data does. It ‘simply’ allows you to retrieve data from your database, such as a Post Term or the entire Post Content.

    It may be something we look at in the future for GenerateBlocks but for now a ToC plugin is the way to go.

    #2064569
    Andrea

    Thanks David, I was also wondering if it was possible to add a dynamically generated table of content without using an extra plugin. Thanks

    Andrea

    #2064767
    David
    Staff
    Customer Support

    Glad to be of help.
    Its definitely plugin requirement today 🙂

    #2067016
    Andrea

    Yes, I understand, thanks. I’ve got my devs to do some coding, and we’ll see if we can sort it out. Cheers

    Andrea

    #2371770
    Wendy

    It’s a shame there isn’t a block, like with Kadence. I don’t want to add another plugin to my site.

    #2372007
    David
    Staff
    Customer Support

    Hi there,

    personally i see this kind of thing as a dedicated plugin requirement.
    Having a specific plugin for just the ToC will probably result in a much lighter and more flexible result then those bundled into a block plugin. Just my 2 cents 🙂

    #2387463
    George

    Like Wendy and others have said, I also believe this will be nice to have it as a Gutenberg Block without external plugins.

    David, can you please explain why the Easy Table of Contents can be a better option in simple words?

    #2387567
    David
    Staff
    Customer Support

    Using a dedicated plugin for niche features like a TOC, ( generally ) means you have a developer who is 100% focused on delivering the best product. Both in terms of support and feature improvements as they are focused on just that one feature.

    When you have a plugin ( or worst still a Theme ) that bundles lots of features, you don’t have the same level of focus. This may result in sub-par features. It most definitely means a lot more code. Code that has to be maintained and supported. And code that is obsolete for any site that doesn’t require that feature.

    #2387622
    Andrea

    Thanks, David. I implemented it by code

    #2387696
    David
    Staff
    Customer Support

    Glad to hear that Andrea!

Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.