Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Uros 9 posts 29 karma points
    May 03, 2014 @ 15:13
    Uros
    0

    Display anchors of a page in drop down menu using macro. Is this even possible?

    Hi to all, I'm new in Umbraco, currently using Umbraco 7.1.1 and I am creating a multi-language site which has, on one page, some anchors which have to be in drop down menu, and which I have made with jQuery, and I had to put absolute links for them to show, few if-s and a lot of headaches. :) I would really appreciate if someone could just tell me if this is possible to achieve using macros, and if it is, teach me master! :) I have searched throughout this forum, i have googled it, and i haven't found the answer. Regards, Uros

    Edit 1: if it isn't possible, could you give me some advice how to realize it in some other way?

  • Sunshine Lewis 31 posts 140 karma points c-trib
    May 03, 2014 @ 20:16
    Sunshine Lewis
    0

    Hi Uros,

    If the anchors correspond with or are generated from Umbraco content then you can spit them out with a macro (or partial view) easily.

    If the anchors are manually created in a rich text block then you won't know exactly where they are and would need code to search for them. You should also be able to use Jquery to find all headings with an id attribute or anchors with a name property. You could probably also do that with razor but it might be easier/more efficient with JQuery.

    Does that help?

  • Uros 9 posts 29 karma points
    May 06, 2014 @ 09:07
    Uros
    0

    Hi Lewis,

    Thank you for an answer, and I'm sorry for not responding a bit earlier, I've been on vacation, so I haven't visited forum, nor have worked on a project. How can I make anchors correspond with Umbraco? The anchors are manually created in templates, not even in rich text block.

    The structure of the navigation should look like this

    Home

    • Page1
    • --Anchor 1.1
    • --Anchor 1.2
    • --Anchor 1.3
    • --Page 1.1
    • --Page 1.2
    • Page2
    • --Anchor 2.1
    • --Anchor 2.2
    • --Popup window 1 (terms and conditions)
    • --Page 2.1
    • --Page 2.2

    . . .

    So, I believe I'm in problem, I don't actually know how to do this in Umbraco. Btw, I'm building 1-to-1 multi-language site. If there was only one language, I would easily do that, but right now, I'm kind of confused how to do that with something I haven't worked with before. I'm junior front-end developer, so you could imagine how hard this currently is for me. :) So, the idea helps, but I would appreciate maybe a bit of code, or where to find it.

    Thanks in advance,

    Uros

  • Steve Morgan 1349 posts 4459 karma points c-trib
    May 06, 2014 @ 11:26
    Steve Morgan
    0

    What do you mean by " The anchors are manually created in templates, "  - are editors able to add varying amounts of content to your document type (e.g. there *might* be a section 1, 2, 3 and 4 and other pages of the same type might only have the first two sections?

    If that's what you're doing it depends on wether the editor adds some text to different page properties / fields (e.g. you have a DocumentType with four sections and they can leave some blank or are you using child nodes / content pickers to build up the page content?

    Post a screenshot of your document type and what you're trying to achieve. 

     

Please Sign in or register to post replies

Write your reply to:

Draft