Copied to clipboard

Flag this post as spam?

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


  • Andy Felton 185 posts 484 karma points c-trib
    Apr 05, 2023 @ 12:17
    Andy Felton
    0

    Getting root node from Block Grid Editor

    Hi,

    I have a partial view which is rendering an element of a Block Grid and have a need to get the content node for the root of the site - how best can this be achieved?

    Thanks

    Andy

  • Huw Reddick 1929 posts 6717 karma points MVP 2x c-trib
    Apr 05, 2023 @ 12:31
    Huw Reddick
    100

    Hi Andy,

    You should be able to use Umbraco.ContentAtRoot()

  • Andy Felton 185 posts 484 karma points c-trib
    Apr 05, 2023 @ 13:26
    Andy Felton
    0

    That was obvious! Thanks for the help.

    Is there a way to get the content of the page containing the block grid?

  • Huw Reddick 1929 posts 6717 karma points MVP 2x c-trib
    Apr 05, 2023 @ 13:51
    Huw Reddick
    0

    you can use Umbraco.Content() and pass in the guid or Id of the page

Please Sign in or register to post replies

Write your reply to:

Draft