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

793 Views Asked by At

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?

2

There are 2 best solutions below

0
Simon Josef Kok On BEST ANSWER

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.

2
Tiziano Rossi On

If the contao template is correctly done i think that the best way to do this is to create a module: (Themes->modules). Here you can create a custom HTML module with the banner inside.

After that go to page layouts and add the module created to the header Column in the section: "Included modules". Do this for every layouts!

Hope this help!