Copied to clipboard

Flag this post as spam?

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


  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Dec 06, 2020 @ 16:54
    Jesper Ordrup
    0

    Render nested Blocklists in custom views (backend)

    This is a question about backend rendering in custom views.

    Is it possible for a blocklist to render a blocklist on a child using a custom view?

    Example

    Ive created a doctype called page with a blocklist. This blocklist contains a component "Column" which again contains a blocklist field.

    I would like to render all components in the colomn blocklist whith their respective custom views. I'm hoping that I can ask the components blocklist to render itself using the already defined custom views?

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Dec 10, 2020 @ 09:15
    Jesper Ordrup
    0

    Is it supported by config or other ways to override the default view in the build in blocklist?

    I've created a custom view that works for all elements in our blocklists and right know I'm facing 6 blocklists with 20 elements in each and I would love not to have to open each and pick a view and a css :-)

    I would like to avoid hacking the buildin - and not so keen on building a new blocklist editor for this.

    /Jesper

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Dec 17, 2020 @ 13:05
    Jesper Ordrup
    100

    We didnt find a way to ask blocklist to render the output of a component. We decided to move all views into directives and render blocklist and components blocklists using a loop with a swich to select directives.

    Goal: add custom view support for each component to render components and component in sublists (n levels). It took a day but was worthwile. It works. It's fast, it's solid and it cleaned up the code - win win win.

    enter image description here Now we have a visual representation of blocks that is informative and clean. It's deliberatly not a 1 to 1 of the frontend design - as that imo brings way too much noise into the backend experience.

    Some more details

    In the blocklists we point each and every blocklist element to the same customview "componentSwitchboard". This makes it really easy to deal with any commen renderings and many other things,

    Each component is defined as a directive which makes it easy to use / reuse view and logic.

    Next step is to polish the backend views. We close - but not done yet.

    /Jesper

  • Gerty Engrie 130 posts 490 karma points c-trib
    Jan 12, 2021 @ 11:34
    Gerty Engrie
    0

    Hi Jesper!

    that looks like an interesting way to load nested block lists. I currently don't see how you render the nested items in the place you want & not all underneath eachother. Would it be possible to share a small code example please?

    thanks!

    Gerty

  • Gerty Engrie 130 posts 490 karma points c-trib
    Jan 26, 2022 @ 16:02
    Gerty Engrie
    1

    Anyone ending up here looking for a better solution --> https://24days.in/umbraco-cms/2021/advanced-blocklist-editor/ :-)

Please Sign in or register to post replies

Write your reply to:

Draft