Hi, this is my first time on this forum and I am using Kentico 11 and I am trying to figure out how my child pages can inherit an image from it's parent page if it is a certain page type. Any help would be greatly appreciated. I am using structured pages which I have put in brackets below if you take a look at my tree.
I want to write a macro that does the following:
If pagetype is SectionPage or MainPage then do this:
<img src="{% GetFileUrlByGUID(HeaderImage, "" ) %}" />
else check if parent pagetype is SectionPage or MainPage, if so do this:
<img src="{% GetParentFileUrlByGUID(HeaderImage, "" ) %}" />
else check if parent parent pagetype is SectionPage or MainPage
<img src="{% GetParentParentFileUrlByGUID(HeaderImage, "" ) %}" />
Here is my tree:
-
Site
-
Our Services (SectionPage)
-
Corporate Services (SectionPage)
-
Human Resources (MainPage)
-
Job Descriptions (StandardPage)
- Management (StandardPage)
Thank you