How to get sub pages to inherit an image from a parent page

Duncan Koza asked on August 6, 2019 23:09

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

Correct Answer

Duncan Koza answered on September 24, 2019 21:35

I re-worded my question and the answer is here: link text

0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.