Reputation: 19607
I have some subpages where there is a single content element with a header in HTML H1.
How can I set the header of this content element to the page's title?
Upvotes: 0
Views: 764
Reputation: 55798
Instead of relying on Content Element (CE) (which de facto may exist OR not AND can have any header set OR not) it's better to... use Michael's suggestion and on the selected branch use the modified template, and place ###PAGE-TITLE###
marker just before the marker where you are rendering-in your ContentElements.
In that case you don't need to modify the way that your <title>
tag is created and you have sure that title always exists and you can be sure that there's always some title.
Of course you'll need to set the default header of the first CE as hidden
(or leave it empty), however you can do it for whole branch with PageTS.
Upvotes: 1
Reputation: 2331
We used a typoscript marker for that. Just define it in your page template and then fill it with the title like this:
PAGE-TITLE = TEXT
PAGE-TITLE.field = nav_title // subtitle // title
Upvotes: 1