Kentico K# Macros only allow a simple if() { } else { }
syntax. You cannot do elseif
statements.
It looks like your syntax, when properly parsed out, should look like this:
{% if (CurrentDocument.ClassName == "custom.sjcg_SectionPage" || CurrentDocument.ClassName == "custom.sjcg_MainPage") { DocumentContext.CurrentAliasPath } else { if(CurrentDocument.Parent.ClassName == "custom.sjcg_SectionPage" || CurrentDocument.Parent.ClassName == "custom.sjcg_MainPage") { CurrentDocument.Parent.NodeAliasPath } else { if(CurrentDocument.Parent.Parent.ClassName == "custom.sjcg_SectionPage" || CurrentDocument.Parent.Parent.ClassName == "custom.sjcg_MainPage") { Parent.Parent.NodeAliasPath } else { CurrentDocument.NodeAliasPath } } } |(identity)GlobalAdministrator%}
I've not tested this and it's pretty messy but should get you going in the right direction.