Copied to clipboard

Flag this post as spam?

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


  • Ben 19 posts 109 karma points
    Sep 13, 2019 @ 11:26
    Ben
    0

    Conditional property editors

    Hi All,

    Im trying to create a doc type which allows the user to create a block of different call to action style content snippets. There are 3 different types of snippets, an image, video and content. Each type of snippet has different property editors.

    The way id like it work is have one doc type which has a conditional property editor which allows the user to select from a drop down which snippet they are going to use and it shows them the relevant property editors associated. This would then be bundled inside nested content which would allow them to add as many as they like.

    I have tried the Conditional Displayers package which works perfectly (other than being able to select a default value) however it doesn't work when used inside nested content.

    Can anyone offer any advice?

  • Lars Heesakkers 38 posts 194 karma points
    Sep 13, 2019 @ 13:29
    Lars Heesakkers
    0

    Will "Nested Content" not suffice? If you create a Nested Content with three different doctypes and set de max and min to 1. You can then check in code which doctype is selected and act on that. https://our.umbraco.com/documentation/getting-started/backoffice/property-editors/built-in-property-editors/Nested-Content/

  • Ben 19 posts 109 karma points
    Sep 15, 2019 @ 11:15
    Ben
    0

    It probably would, think im probably trying to over complicate it.

  • Mario Lopez 168 posts 952 karma points MVP 3x c-trib
    Sep 16, 2019 @ 04:03
    Mario Lopez
    100

    Hi Ben,

    The problem is that Conditional Displayers uses an element selector that is not available in Nested Content. you have more info here:

    https://github.com/KOBENDigital/ConditionalDisplayers/issues/7

    bgunnarsson has created a PR and as per his comments this should be resolve in Umbraco versions 7.15.3 and 8.1.4

  • Ben 19 posts 109 karma points
    Sep 16, 2019 @ 07:51
    Ben
    0

    Thanks for the comment Mario, I did have a quick look through the issues list but must have missed it.

  • Jan Bengtsson 64 posts 107 karma points
    Oct 01, 2019 @ 11:28
    Jan Bengtsson
    0

    Mario,

    I'm not able to get Conditional Displayers to work with Nested Content in Umbraco 8.1.5. Do you know if this issue was actually fixed in 8.1.4?

    /Jan

  • Mario Lopez 168 posts 952 karma points MVP 3x c-trib
    Oct 01, 2019 @ 12:12
  • Jan Bengtsson 64 posts 107 karma points
    Oct 01, 2019 @ 13:05
    Jan Bengtsson
    0

    There are data-elements for each property editor within my Nested Content. E.g.:

    <div class="umb-property ng-isolate-scope" property="property" ng-class="{'umb-nested-content--not-supported': property.notSupported}" data-element="property-containerPuffs___linkCustom">
    

    But still not working - both content types referenced in my Conditional Displayer are displayed as default.

  • Mario Lopez 168 posts 952 karma points MVP 3x c-trib
    Oct 01, 2019 @ 22:32
    Mario Lopez
    0

    Hmmm, I'll take a look but I think the plugin will need a different approach with v8, the current one is too hacky using jQuery.

  • Jan Bengtsson 64 posts 107 karma points
    Oct 02, 2019 @ 07:06
    Jan Bengtsson
    0

    It's probably a good idea. I can see that Conditional Displayer works well outside Nested Content in Umbraco 8 (at least the checkbox alternative) but not within, as said. And that's a pity for such a useful plugin.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft