Copied to clipboard

Flag this post as spam?

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


  • Raluca Dumitru 33 posts 174 karma points
    Nov 23, 2018 @ 16:55
    Raluca Dumitru
    0

    Nested content items styling

    enter image description here I want to style the items from nested content, separately. Does anyone know how to do that? I have question and answer items, that I would like to appear differently on the page.

    Thank you

  • Laura Weatherhead 25 posts 153 karma points MVP 6x c-trib
    Nov 26, 2018 @ 15:50
    Laura Weatherhead
    0

    Hi Raluca,

    What exactly are you trying to style?

    You can change the icons and update the "Item 1" text to display one (or more) of the properties of the nested content item using the data type in the developer section. e.g. Changing nested content template using Angular syntax

    Would that be sufficient, or are you trying to do something more specific?

    Cheers,

    Laura

  • Raluca Dumitru 33 posts 174 karma points
    Nov 26, 2018 @ 16:42
    Raluca Dumitru
    0

    Hi Laura,

    So I want that item1 to be styled differently from item2, for example item1's background to be red and item2's blue. And I don't know how to access this items individually, but only through a for loop , and then I cannot set their classes separately for styling.

  • Laura Weatherhead 25 posts 153 karma points MVP 6x c-trib
    Nov 26, 2018 @ 17:16
    Laura Weatherhead
    1

    Hey Raluca,

    I just ran up a wee test case for you there to test a hunch, but I think that you're going to struggle with changing the built-in nested property doctype.

    Your best bet (if the styling if a hard requirement) would be to create your own custom property editor and re-create the nested content structure but with your own styling and classes to extend the base styles.

    There is some great documentation on how to get started on creating your own property editor here: https://our.umbraco.com/documentation/Tutorials/Creating-a-Property-Editor/

    I have actually done something similar on one of our custom dashboards - adding a description/status based upon input data Custom nested content

    Cheers,

    Laura

  • louisjrdev 107 posts 344 karma points c-trib
    Nov 27, 2018 @ 09:52
    louisjrdev
    100

    Have a look at css odd and even styling rules:

    https://www.w3.org/Style/Examples/007/evenodd.en.html

  • Raluca Dumitru 33 posts 174 karma points
    Dec 10, 2018 @ 11:34
    Raluca Dumitru
    0

    Hi ,

    Sorry for the late reply, I have just returned from holiday.

    Thank you very much for the answers, I actually went with Louis's solution, odd and even. I think that was the easiest approach :)

  • louisjrdev 107 posts 344 karma points c-trib
    Dec 10, 2018 @ 12:15
    louisjrdev
    0

    Hi Raluca,

    Glad this worked, could you please mark my answer as solved?

Please Sign in or register to post replies

Write your reply to:

Draft