Search code examples
kentico

How to have H1 and byline in the master page - Kentico


I'm trying to work out a way I can add my H1 and byline markup to my Root master page and then have all the pages underneath fill these fields in. I'm using the Portal Engine development mode.

The H1 and byline are in a different web part zone to the page placeholder. They are showing on all the pages under my root node but I can't find a way to make populate the title or byline on those pages.

I've tried a few things: - editable text web part - but this is only editable on the Root node and not the pages underneath - I thought maybe I could use <%# Eval("Byline" %> and add this as a field to the Page type but that doesn't show through either.

Is there any way to include something in the master page that is dynamically filled in (or editable in the designer) on all pages under the root node? Or do I need to move myH1 and byline out of the master page and include in every template that my pages use?


Solution

  • You can add additional field to your page type named 'Byline'. This field will be editable on Form tab of each page. Then you can include some viewer web part like Document Viewer or repeater. Then configure Path like './' (it means to display information for current page). And add transformation where you cat do something like <%# Eval("Byline") %>.

    Or alternative way is to use static html web part and add macro there {%CurrentDocument.Byline%}.