November Happy Hour will be moved to Thursday December 5th.

Blocks with no model not creatable

Vote:
 

Hi,

For a client's project we need to create block types at runtime. This means that we create the block type without a backing model (class). The creation goes well and the block type is visible as a content type in the admin interface. However, the new block type is not available when trying to create an instance of it from the edit interface. I click the "+" icon in the assets pane, but the created block type is not in the list of available types.

Grateful for some insight.

#247252
Jan 19, 2021 10:24
Vote:
 

Does the Content Area of your page allow you to drag the runtime created blocks?

#247276
Jan 19, 2021 15:08
Vote:
 

Have you created a controller and view for the dynamic block, If not then create and try.

#247287
Jan 19, 2021 21:57
Vote:
 

Hi,

From the description, I'm guessing you're using the IContentTypeRepository to create those new block types so there are a couple of things which spring to mind. When you create your content type, are you setting the "IsAvailable" property to true? You can check this setting in admin -> content types by clicking on your content type. You can the click on the settings button in the information panel and verify that the "Available in edit view" checkbox is ticked. On that same screen it would also be worth looking at the "Access level" panel to ensure the relevant users have access to create blocks of that type.

#247355
Jan 20, 2021 14:52
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.