Copied to clipboard

Flag this post as spam?

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


  • Christoffer 1 post 71 karma points
    Jun 11, 2017 @ 08:16
    Christoffer
    0

    CurrentPage.AncestorOrSelf(1) vs. CurrentPage.Site()

    Hi

    Can anyone explain the difference between CurrentPage.AncestorOrSelf(1) and CurrentPage.Site()?

    From my understanding AncestorOrSelf(1) checks if the node is at level 1, and if it's not it will take the ancestor that is. But how is CurrentPage.Site() different from this?

    Thanks in advance

  • Laurent Lequenne 120 posts 245 karma points
    Jun 12, 2017 @ 08:59
    Laurent Lequenne
    0

    it acts like :

     return content.AncestorOrSelf(1) 
    
  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    Jun 12, 2017 @ 09:00
    Alex Skrypnyk
    101

    Hi Christoffer

    CurrentPage.AncestorOrSelf(1) vs. CurrentPage.Site() are the same method, Site() was created for convenience and less letters in the code. So .Site() is more preferable method of getting root node.

    Thanks, Alex

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies