how to write something in <head> ?

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

how to write something in <head> ?

Post by onoehring » 2020-11-09 08:09

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

User avatar
landinialejandro
AppGini Super Hero
AppGini Super Hero
Posts: 126
Joined: 2016-03-06 00:59
Location: Argentina
Contact:

Re: how to write something in <head> ?

Post by landinialejandro » 2020-11-09 11:43

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.
Alejandro.
AppGini 5.98 - Linux OpenSuse Tumblewweed.

Some of my posts that may interest you:
:arrow: Landini Admin Template: Template for Appgini like AdminLTE
:arrow: Profile image plugin: add and changue image user profile
:arrow: Field editor in table view: Configurable fast edit fields in TV
:idea: my personal page

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: how to write something in <head> ?

Post by onoehring » 2020-11-11 12:48

Hi landinialejandro,

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

Olaf

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: how to write something in <head> ?

Post by onoehring » 2020-11-11 16:27

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

User avatar
landinialejandro
AppGini Super Hero
AppGini Super Hero
Posts: 126
Joined: 2016-03-06 00:59
Location: Argentina
Contact:

Re: how to write something in <head> ?

Post by landinialejandro » 2020-11-11 22:19

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!
Alejandro.
AppGini 5.98 - Linux OpenSuse Tumblewweed.

Some of my posts that may interest you:
:arrow: Landini Admin Template: Template for Appgini like AdminLTE
:arrow: Profile image plugin: add and changue image user profile
:arrow: Field editor in table view: Configurable fast edit fields in TV
:idea: my personal page

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: how to write something in <head> ?

Post by onoehring » 2020-11-12 16:27

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

Post Reply