SendingContentNotification - is there a way to get the content node being edited?
Multisite solution - I would like to hide/show some properties in a blocklist module depending on where I am in the content tree.
The problem is that the SendingContentNotification contains no info about the current node being edited, but only about the current blocklist element being edited.
Any idea how I could get the current editing node within a SendingContentNotification?
I had a similar issue on a site, using Contentment, in a block, I wanted to show a dropdown of theme colours to apply, but because there were microsites in the backoffice, I wanted the theme colours to be different in the dropdown.
Contentment has this cool DataList option, where it is aware of which page it is on, so you can make 'context' specific choices appear in the list...
Which basically involved using the SendingContentModel notification of the 'page' to add to a session variable the current page node id (or parent id if new) to then use in the DataList
I'm not sure if something similar would help solve this issue for you?
Thank you for your suggestion, and session variable is probably the best way to go. Right now I'm trying the ConditionalDisplayer Checkbox and set it to true in the block in the sendcontentnotfication of the page. Your suggestion is probably better. Don't understand why you dont get the id for the parent in the block, is that a bug, seems like a miss in the API.
SendingContentNotification - is there a way to get the content node being edited?
Multisite solution - I would like to hide/show some properties in a blocklist module depending on where I am in the content tree.
The problem is that the SendingContentNotification contains no info about the current node being edited, but only about the current blocklist element being edited.
Any idea how I could get the current editing node within a SendingContentNotification?
I would really like an answer to this as well. I have a block which are supposed to show a property if its on one type of page, but not on another.
Hi Andrei/Jonas
I had a similar issue on a site, using Contentment, in a block, I wanted to show a dropdown of theme colours to apply, but because there were microsites in the backoffice, I wanted the theme colours to be different in the dropdown.
Contentment has this cool DataList option, where it is aware of which page it is on, so you can make 'context' specific choices appear in the list...
but in a block, it does not have this 'context'.
The workaround was here:
https://github.com/leekelleher/umbraco-contentment/issues/30#issuecomment-1216915615
Which basically involved using the SendingContentModel notification of the 'page' to add to a session variable the current page node id (or parent id if new) to then use in the DataList
I'm not sure if something similar would help solve this issue for you?
regards
Marc
Thank you for your suggestion, and session variable is probably the best way to go. Right now I'm trying the ConditionalDisplayer Checkbox and set it to true in the block in the sendcontentnotfication of the page. Your suggestion is probably better. Don't understand why you dont get the id for the parent in the block, is that a bug, seems like a miss in the API.
Hi Jonas
Just spied this fix...
https://github.com/umbraco/Umbraco-CMS/pull/15063
Which therefore might lead to being able to grab the page I'd for a dataType inside a block...
Regards
Marc
is working on a reply...