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?
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.
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.
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.
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?
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?
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
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.
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
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
Anyone ending up here looking for a better solution --> https://24days.in/umbraco-cms/2021/advanced-blocklist-editor/ :-)
is working on a reply...