Copied to clipboard

Flag this post as spam?

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


  • Greg Berlin 818 posts 634 karma points
    Aug 08, 2015 @ 08:49
    Greg Berlin
    0

    Get Content Item of a child of a page

    This is a bit of a weird one, hopefully somebody can help me figure it out.

    I have a page structure like this:

    Home

    • HomeSection1

      • Page 1
      • Page 2
    • HomeSection2

      • Page3
      • Page 4

    HomeSection 1 and 2 are not pages, but rather just blocks on the homepage.

    Page 1-4 are actual pages

    I want to create a macro to insert into the conten blocks for the HomeSection items, which will render a list of links.

    Problem 1: Why is there no Multi Content Picker type for macros??? Grrrrrr Anyway if there's a quick fix for this, I'd love to hear about it. If not, I've put the multi content picker on the HomeSection item so users can just pick them there.

    Problem 2: How can i get the current HomeSection item from the Macro?

    @Model.Content and @CurrentPage in the Partial view macro returns the partent page (Home), not the section that's been rendered. Is there a way to find out exactly which node is the container of the macro (as opposed to what page we're on)?

    I've thought of adding a picker to the Macro so the user specifies where the items to display can be found, but this shouldn't be something the user has to pick.

    Any ideas?

  • Charles Afford 1163 posts 1709 karma points
    Aug 10, 2015 @ 10:27
    Charles Afford
    0

    Hi what language are you using? Why do you need to use a macro? Charlie :)

  • Greg Berlin 818 posts 634 karma points
    Aug 10, 2015 @ 10:36
    Greg Berlin
    0

    It's MVC, and I'd like to use a Macro to give my client the ability to insert the links at any point in the rich text that they like.

  • Charles Afford 1163 posts 1709 karma points
    Aug 10, 2015 @ 10:39
    Charles Afford
    0

    I could be being stupid? But why do you need a macro to do that. There is a link creator already in the RTE.?

  • Greg Berlin 818 posts 634 karma points
    Aug 10, 2015 @ 11:50
    Greg Berlin
    0

    Yeah but I try to prevent client's doing too much in the RTE, they'll just end up breaking the layout and styling of the site. If i could give them the ability to insert a macro, provide a header and select which links to render out, it gives me the ability to enforce the style of the site while giving them the ability to choose what to show and not to show.

    I don't "HAVE" to use a macro, but in this case it seems like a sensible way to achieve what I"m trying to do. And it shouldn't be so difficult really.

Please Sign in or register to post replies

Write your reply to:

Draft