header.php override not working


Network license
License owner
▶🚶‍Reproduction steps
  1. Copy 'header.php' from Peafowl theme directory, into /app/themes/Peafowl/overrides/views/header.php
  2. Edit copied 'header.php' nav text from "About", to "More..." (or any other text)
  3. Save the edited file, refresh Chev home page, and cleared the browser's cache for good measure.
😢Unexpected result

There's no change in the text when viewing any site page.

📃Error log message

There are no errors shown or included in any server logs.

Misc. Notes...

I just completed an update from v3.13.5 to v3.14.0 to see if there was a fix. This same behavior occurred before the update was done. Following the same procedure to create an override for 'index.php' and modifying the text blurb on uploading, it all works exactly as expected.


Phoenix Foto Service
Beta tester
I have not tested your variant but I assume that this is not a bug, but a user error.
Please use the following file: \app\themes\Peafowl\custom_hooks\header.sample.php
Copy this to: \app\themes\Peafowl\custom_hooks\header.php
open the new header.php in dir custom_hooks
The Content of file header.php in custom_hooks is between </head> and <body>

Use the file \app\themes\Peafowl\custom_hooks\head.php to add content within the head tag.

To add content within the body tag (at the beginning) use the file \app\themes\Peafowl\custom_hooks\body_open.php

See: https://chevereto.com/docs/theme#custom-hooks


Network license
License owner
Thanks for the reply, but I have no need of a custom hook. I'm simply wanting to customize a single word of text that's hard-coded into the core header file... which is what the override functions are for. I used the exact procedure as detailed in the documentation - and it failed to execute the override. In an earlier release prior to the last few rounds of updates it was working fine, and now it doesn't - making it a bug.


Network license
License owner
As an update... I've tried to get the same basic end result by using a language file override instead of a theme view override, and that does work as expected.


Chevereto Developer
Chevereto Staff

This is just a confusion in how that system works. I've tweaked the documentation a little bit:

Theme overrides
Theme overrides works by detecting a file override which replaces a given theme file, so the system will use the override instead of the default file. Overrides are placed at app/themes/Peafowl/overrides. For example, let's say you want to replace app/themes/Peafowl/views/image.php you have to simply copy the file to app/themes/Peafowl/overrides/views/image.php and the system will now use the override instead of the default file.
From your instructions:
  1. Copy 'header.php' from Peafowl theme directory, into /app/themes/Peafowl/overrides/views/header.php
The path of header override is /app/themes/Peafowl/overrides/header.php

And I have tested it on the demo: