Your macro should read something like this:
{% level1 = "/{0}/{1}/%"; level2 = "/{0}/{1}/{2}/%"; if (CurrentDocument.NodeLevel != 2 || CurrentDocument.NodeLevel != 3 ){ level2 } else { level1 } |(identity)GlobalAdministrator%}
CurrentDocument
and CurrentPageInfo
are two different objects. When referencing documents on the live site, use CurrentDocument
. This is most likely why you were always returning false. Also as Trevor mentioned, you don't want to set the current documents nodea alias path, you want to return the actual path to the property in the webpart.