Dynamic Table of Content widget

Phil
Phil Member Posts: 1

Has anyone seen a good way to create a dynamic widget for blog posts that will automatically create a table of contents?

Ideally, I would also like to figure out a way to make this widget area "sticky".


Answers

  • community_manager
    community_manager Administrator, Moderator Posts: 297 Duda Staff

    Hi @Phil! Tagging a few community leaders that might know:

    @Elizabeth_Fedak

    @Shane_Hodge

    @Aj_Pfeil

  • Aj_Cre8
    Aj_Cre8 Member Posts: 630 MVP

    So, I would think that this can be done, but let me verify...

  • Shane_Hodge
    Shane_Hodge Member Posts: 122 MVP

    @Aj_Pfeil will be good to hear what you discover

  • Aj_Cre8
    Aj_Cre8 Member Posts: 630 MVP

    So, because we don't have any direct API calls within the Duda Blog we can not access data for it to build this as a Custom Widget.

    It will need to be built manually per blog using anchors and links 😞😞.

  • Elizabeth_Fedak
    Elizabeth_Fedak Member Posts: 106 MVP

    I'm pretty sure this one would work best as a manual build w/ anchor links as Aj suggested. You'd have to manually create the anchor links either way. You can potentially make a custom widget that finds all of the anchor links and puts them in a list like that on a blog page though.

  • David_Marden
    David_Marden Member Posts: 2

    Is there a tutorial or video on how to make a custom table of contents per blog?

  • Elizabeth_Fedak
    Elizabeth_Fedak Member Posts: 106 MVP
    edited May 2022

    @David_Marden You can set anchor links by clicking on an element and selecting "Set As Anchor".

    Then create an inner row or design element you'd like to use for your table of contents. Type in the title for that section, highlight the text, select the "LINK" icon, and connect it to that specific anchor link.

  • SimonW91
    SimonW91 Member Posts: 1

    I can't get anchors to work when I create them in blog posts - when I try to link to them using the link popup in the editor, and select "Anchor", no blog post anchors are found. Am I doing something wrong?

  • Aj_Cre8
    Aj_Cre8 Member Posts: 630 MVP

    You need to add the blog post as an external website. The post are not available as existing pages