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

  • [Deleted User]
    [Deleted User] Posts: 215 Duda Staff

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

    @Elizabeth_Fedak

    @Shane_Hodge

    @Aj_Pfeil

  • Aj_Cre8
    Aj_Cre8 Member Posts: 342 MVP

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

  • Shane_Hodge
    Shane_Hodge Member Posts: 78 MVP

    @Aj_Pfeil will be good to hear what you discover

  • Aj_Cre8
    Aj_Cre8 Member Posts: 342 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: 95 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: 95 MVP
    edited May 27

    @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.