Search code examples
phpcontao

How do I add some displayable HTML to the header of every page in Contao


I have very little experience with Contao and I am in the process of redirecting users from an outdated Contao website to a new Wordpress website.

I need to write some HTML that will display a clickable banner on the header of every page on the old website. I have no idea where the header file resides though, nor how to find it using the CMS.

I have tried finding documentary online but it is very scarce.

Can anyone help me?


Solution

  • Another option is to create a new template (in Templates under Layout in the menu on the left) to replace the fe_page template. If a template like that has already been created you should edit that one. That is the fundamental structural template to all pages. In templates the pencil icon edits the template name; to edit the markup of template, you must click on the icon that looks like cog wheels.

    Now it can also be, that such template has been created and has been renamed and is in use. You can verify this in Themes -> Layouts -> Edit (pencil icon) and under Expert settings see Page template. If it says fe_page it is the default template, if it says fe_somethingelse it has been renamed.

    I hope this way you get some idea about how Contao's templating system works. Here is some more information: https://contao.org/en/manual/3.3/managing-pages.html#themes-versus-front-end-templates though it isn't much.