How to set up a page specific header background image?

Post Reply
User avatar
Fleetenkieker
Jr. Bludit
Posts: 3
Joined: Sat May 10, 2025 2:35 pm

Hi all,
I want to use page specific header background images.
The general image ist defined in the header.php, included in the /mytheme/index.php:

Code: Select all

<header style="background: black url(https://mydomain/bl-themes/mytheme/img/image.png);">
I thought the easiest way would be to have a user defined field that could be filled via the settings > options tab when editig a (static) page like the 'template' field that I use:

Code: Select all

 "header-img": {
        "type": "string",
        "placeholder": "Background image in header"
    }
It didn't work as in the /mytheme/index.php, the header.php ist included before the user defined fields of the page are read. I concluded that this procedure is rather targeted to the content of the page, not the style.
How could I influence the style of the <header> background after the page template is loaded?
Thanks in advance for help.
Bludit v3.16.2; additional Plugins: MultiBlock v3.1, MultiFields v2.0
Post Reply