Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm hoping somebody within the community can help offer some guidance...
I am a Product Owner and I inherited Umbraco when starting a new role last year. Unfortunately, we do not currently have dedicated technical support and we have a bit of a skills gap with respect to Umbraco. This is something I'm working hard to resolve over the next few months and beyond, but in the meantime I'm hoping the amazing community may be able to help.
We are currently on version 7.6.11 of Umbraco - we are planning to upgrade to 8/9 over the next 6-12 months, but that's obviously going to take some time.
To provide context, a high level summary of our setup is as follows:
I am trying to understand whether there is a way in Umbraco to programmatically understand document relationships when completing a save and publish event?
For example, we have the concept of Pages, Modules and Blocks:
Page and Module Relationships
Module and Block Relationships
Sorry for the long pre-amble, but think the above is important context to the questions I'm now going to ask.
In short, when making an edit to either a module or a block, we ultimately want to understand which page URL's have been updated as a result of the edits (as the save and publish is against modules or blocks in this case, rather than the Page URL).
Hopefully someone may be able to help steer me in the right direction. Thanks in advance :)
Any help out there friendly people? :)
Two concepts you want to have a look at...
Relations - If you look in the Developer section of Umbraco you will find Relations - they are a way to store a relationship between two items in Umbraco, eg content to content or content to member. You can create different 'relation types' (all sites come with a 'relate on copy' relation type -that tick box you see when you copy a node) and then relate two distinct entities together underneath that relation type - and then you can query the items in both directions, eg find all the 'Cousins' of the current node (the family analogy soon breaks down, I mean are they Aunts/Uncles, etc)
The RelationService is what you use to create relations and to query them:
Content Saving Events - Whenever a content item is saved in the backoffice then two c# events are thrown that you can handle and 'do stuff'...
The idea then would be to create a Relation Type called 'BlocksToPage' or 'ModulesToPage and 'whenever' you save one of your content items, handle the 'saved event', and read the multinode tree picker, to see which blocks or modules have been picked - and then find all the relations for that current page, and create / remove to match the Mutlinode tree picker etc
Then when one of the modules or blocks are saved, you can handle their saved events, to query the relations API - to find out which pages they have been picked on...
... you can even create a custom property editor on the blocks and modules that will list their 'related pages'...
That's the gist of how you might approach it, but probably depends on what you are trying to do when something is saved, as to whether it's the most performant approach or not!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted