Page 1 of 1

how to write something in <head> ?

Posted: 2020-11-09 08:09
by onoehring
Hi,

I just stumbled about the problem, that I actually want to include something into the <head>...</head> section of the output html that is delivered to the browser.
I notice, that this is not possible using the header-extras.php as this file is appended at the end of the header.php file.

Is there a simple way to do this with hooks/my own code without touching regenerated files?

Olaf

Re: how to write something in <head> ?

Posted: 2020-11-09 11:43
by landinialejandro
Hi olaf i think you can do a function in global php to check if you code is Inside header.php inside head. if not there injected again an refresh de page.

Re: how to write something in <head> ?

Posted: 2020-11-11 12:48
by onoehring
Hi landinialejandro,

to look into __gobal.php is a good idea.
Thank you.

Olaf

Re: how to write something in <head> ?

Posted: 2020-11-11 16:27
by onoehring
Hi,
__global.php is afaik loaded for the login page only, but not once the user has logged in. So this approach does not seem to work.

Olaf

Re: how to write something in <head> ?

Posted: 2020-11-11 22:19
by landinialejandro
hello! __global.php is loaded every time lib.php is called, and this happens every time a page is reloaded. You should not use the functions that are already included there, create your own and run it right there.

I use this place to verify that my template is as it should be after the user has made a change in his project. To be more specific I check the header.html and if it is not as it should I modify it.
you can see here:

https://github.com/landinialejandro/myn ... global.php

in line 3 would be my functions.

I hope it is useful to you

Greetings!

Re: how to write something in <head> ?

Posted: 2020-11-12 16:27
by onoehring
Hi,

that's great news - I did not know __global.php is loaded every time. Thanks for the hint.
Also thanks for the link.

Olaf