Question:
is there a way to make a dynamic In page-menu in a dynamic page ?
What i’m trying to achieve:
i’m making a portfolio and right now i’m making a dynamic page where i’ll discuss my projects in detail and i have a side menu where i want to have a navigation menu where you can click and it will scroll to the right section. I saw that it’s possible to do fairly easily for static pages where you can either use sections as anchors or place anchors by hand but in my case it will be dynamic pages and i use one rich content where i’ll discuss everything so i can’t use a section as an anchor and i can’t place anchor by hand because it’s a dynamic page so each page will be fairly different
What i’ve already tried:
i’ve tried to populate an in-page menu through code but from what i’ve seen in the documentation it’s not possible.
i also tried to create anchors in my rich content field where i would have title by using html like “< div id=“AnchorTitle”>< /div>” and place those where i need an anchor and then feed buttons in a repeater with the informations.
So for example if i have X anchors it creates X buttons with the names used in the div, i was able to achieve that but not the Onclick event because from what i understood the scrollto function can only use $w elements.
So then i thought about spawning a hidden $w element through code right where i have my html anchor and then link my buttons in the repeater with the hidden $w elements so that it scroll to the right location, is there a way to spawn $w through code ? or is there any better way at all to do what i’m trying to achieve ? i’m open to suggestions
i heard about custom elements but i’m not sure how i could achieve it like that