Dynamic block support


#1

We are looking to possibility creating dynamic blocks like https://docs.magento.com/m2/ee/user_guide/cms/dynamic-blocks.html

Why: Now, when you have some website, you must hardcore content + blocks. But what if (for example) is homepage like this:

logo
carousel
paragraph title 1
text 1
image
paragraph title 2
text 2

Now, we must create “homepage” as single content and hardcode these elements. But what is somebody wants to add third paragraph, or put carousel bellow first paragraph? If there will be support for dynamic blocks, it will be possible.

Our proposal is to use current features. We propose to use “array” of undefined “relations”. For example I create scheme called page and hardcode only “title”/“id”,“meta” and put there entity “array” and allow to put there “reference” entity without scheme. Now this is possible and if you switch to content, it will looks like this:

So, maybe If we only allow to dynamically add reference to any existing entity, we can edit content and move dynamic content block.

Note: Using array is only hint how to achive with less programming, there is a better solution adding new data type called “dynamic block” of course.

Thanks for comments !


#2

I am not sure if it makes sense, If the content is consumed by another consumer, such as an app or mobile view the arrangement might be totally different.

Why not implement it in your UI, as a react developer you have a great toolset for that: https://github.com/react-page/react-page


#3

Yes, I understand, but Squidex is very powerful using GraphQL. And if Squidex is holder of page content & structure, you can download whole “page” scheme via graphQL, map it to react app components and dont care about page structure. You will become a real “content” builder, instead of only “hardcoded input filler”.


#4

I see, but I am not sure, if a schema is what you want for that.

Two reasons:

  • No WYSIWYG
  • Very often you do not want to select content items. Instead you have business requirements like:
    • Show me the 3 newest articles +
    • Show me the a selected main article +
    • Show me the latest blog posts

#5

Sorry, but I am not sure, if we are talking about the same functionality. Dynamic blocks allows you to dynamically create page content + page structure/layout. You are talking about usecases/BRQs about working with entitites.


#6

Maybe imagine this usecase: You want to create website. There are similar pages except homepage and contact page. Each page has metadata (a lot of :)) and two paragraphs and two headings. Now I must create these entities:

  • homepage (single content)
  • contanct page (single content)
  • page (multiple content)

In these entities i have duplicit schema. In react application, programator must prepare three page types and ask three different ways for content using GraphQL.

So, this is reason, where dynamic blocks can help, because entity will be only one - PAGE (multiple content). And I create homepage and plug there dynamic block, contact page with another dynamic blok and other pages will contain the same content. React developer dont care about page type, because he map GraphQL content to widgets.

Best,


#7

How would it look like in graphql? Graphql is typed. Is there a concept of inheritance?