Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andrei 15 posts 99 karma points
    Jul 03, 2023 @ 11:20
    Andrei
    0

    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?

  • Jonas Rosqvist 2 posts 72 karma points
    Jan 16, 2024 @ 14:52
    Jonas Rosqvist
    0

    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.

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Jan 16, 2024 @ 16:30
    Marc Goodson
    0

    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

  • Jonas Rosqvist 2 posts 72 karma points
    Jan 17, 2024 @ 11:49
    Jonas Rosqvist
    0

    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.

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Jan 17, 2024 @ 18:43
    Marc Goodson
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft