we are using the block list option and have created a large number of blocks for our site to allow content editors to build various pages without developer input.
one thing we have not been able to do is find a way to identify where or if a block is being used we have tried tools like diplo.godmode etc.
but nothing we have found can give us a break down on where a block is being used, if we could produce a report somehow to show a blocks usage that would be great but any other tool/plugin would be useful.
we are on umbraco 12 and use an on premises installation.
Are they items in the content tree that the editors pick?
So you have a 'Shared Content Block' and the editors pick a reusable content block from the tree? if so then this will create a Relation between the reusable block, and you can see where they are used on the 'info' tab of the reusable content item.
eg
But if you are talking about the usage of 'Block Types', eg where has the Video Block Type been used, then, because that is stored in a big blob of JSON in the database for the Block List property editor it can be difficult to determine!
If this is just a 'one off audit' - You can query the database umbracoPropertyData table, to look at the stored database for the Block List raw data and the ids of the different Element Types...
or similarly if you have uSync installed you can export all the content of the site into XML files and search them...
But if its for more of an ongoing thing, then you could create in the Relations section a new Relation Type called Block Type Usage.
This creates a place to store, ermm relations between DocTypes and Documents (content nodes).
Then you could tap into the ContentService's notifications:
and handle the Saving event, see which blocks are on the page that is being saved, and use the RelationService to create a relation between them under the new relation type
similarly for the deleting event, removing any relations...
Then you could build a custom dashboard, https://docs.umbraco.com/umbraco-cms/tutorials/creating-a-custom-dashboard that used the RelationService to pull back all the relations from the Relation Type and group together by 'Document Type' listing all the content items that use that particular Doc Type!
Identifying where a Block is being used
Hi
we are using the block list option and have created a large number of blocks for our site to allow content editors to build various pages without developer input.
one thing we have not been able to do is find a way to identify where or if a block is being used we have tried tools like diplo.godmode etc.
but nothing we have found can give us a break down on where a block is being used, if we could produce a report somehow to show a blocks usage that would be great but any other tool/plugin would be useful.
we are on umbraco 12 and use an on premises installation.
Peter
Hi Peter
How have you setup the reusable blocks?
Are they items in the content tree that the editors pick?
So you have a 'Shared Content Block' and the editors pick a reusable content block from the tree? if so then this will create a Relation between the reusable block, and you can see where they are used on the 'info' tab of the reusable content item.
eg
But if you are talking about the usage of 'Block Types', eg where has the Video Block Type been used, then, because that is stored in a big blob of JSON in the database for the Block List property editor it can be difficult to determine!
If this is just a 'one off audit' - You can query the database umbracoPropertyData table, to look at the stored database for the Block List raw data and the ids of the different Element Types...
or similarly if you have uSync installed you can export all the content of the site into XML files and search them...
But if its for more of an ongoing thing, then you could create in the Relations section a new Relation Type called Block Type Usage.
This creates a place to store, ermm relations between DocTypes and Documents (content nodes).
Then you could tap into the ContentService's notifications:
https://docs.umbraco.com/umbraco-cms/reference/notifications/contentservice-notifications
and handle the Saving event, see which blocks are on the page that is being saved, and use the RelationService to create a relation between them under the new relation type
https://docs.umbraco.com/umbraco-cms/reference/management/services/relationservice
similarly for the deleting event, removing any relations...
Then you could build a custom dashboard, https://docs.umbraco.com/umbraco-cms/tutorials/creating-a-custom-dashboard that used the RelationService to pull back all the relations from the Relation Type and group together by 'Document Type' listing all the content items that use that particular Doc Type!
regards
Marc
is working on a reply...