I haven't gotten anything to work for default values or content templates in block elements. Plenty of things work for normal document types, just not element types within a blocklist.
Thank you for your input, I have the partials and everything. I understand pulling block element values and the partial views.
What I can't seem to figure out is setting default values, or applying content templates (https://our.umbraco.com/documentation/Fundamentals/Backoffice/Content-Templates/).
For instance, I have an Article element type (blocklist), with a dropdown field that is text-size (small, medium, large). I want that field to default to medium. So, when an editor creates a new block element of type Article, then medium is pre-selected.
How can content templates be applied to block list elements, OR default values set for them?
How can content templates be applied to block list elements? OR how can default values be given to blocklist items?
Currently I do not see a way to apply content templates to element types at all.
Also, the SendingContentNotification way of setting default values does not work for block list items.
I found this very helpful when playing with Blocklist.
https://umbraco.com/blog/deep-dive-the-block-list-editor/
I haven't gotten anything to work for default values or content templates in block elements. Plenty of things work for normal document types, just not element types within a blocklist.
Hi Joshua,
You need to create contenttemplates for your elements under the folder \Views\partials\blocklist\components
The templates should have the same name as the elements doctype
This is what I have, it is a blocklist that displays menus and content blocks in the page footer.
Each available block is an based on an Element (so no default template) This is the content of blocklist view folders
CompanyInfo is the template for Company Info, it is a very simple template as the element just contains an RTE, the template code is therefore simpl
The footermenu is a bit more complex as it contains nested block items, but can post it if you need an example
Thank you for your input, I have the partials and everything. I understand pulling block element values and the partial views.
What I can't seem to figure out is setting default values, or applying content templates (https://our.umbraco.com/documentation/Fundamentals/Backoffice/Content-Templates/).
For instance, I have an Article element type (blocklist), with a dropdown field that is text-size (small, medium, large). I want that field to default to medium. So, when an editor creates a new block element of type Article, then medium is pre-selected.
I have tried notification handler to no avail. Similar to this, which only seems to work on standard document types, not element/blocklist: https://our.umbraco.com/forum/umbraco-7/using-umbraco-7/73709-default-value-on-property-in-document-type
Ok sorry, you mean custom back office views, have you read https://our.umbraco.com/documentation/Tutorials/Creating-Custom-Views-for-Blocklist/
You should be able to set default values using angular in the template I'm guessing
Hmm, the question was about the content templates and the answer about content custom views. They are two different things.
My question is how to apply a custom content template that is of an element type. I can create a content template for an element type in the BO:
Under
Settings > Content Templates > Create > Create an item under Content Templates
I am presented with both document types and element types to use and can create a template fo an element type, eg. block.
But going to Content and creating a new content - I can't see the way to actually use the added element content template when creating a content.
is working on a reply...