Hello. I tried to find out myself, but forgive me for my stupidity, pages like this
https://docs.backdropcms.org/api/backdrop/core%21includes%21common.inc/function/backdrop_get_html_head/1
tell me absolutely nothing (why is documentation always so inhumane?).
In short, all I need is to add the phrase “user-scalable=no” to the “viewport”, otherwise my theme does not behave correctly on mobile devices. Please, tell me the right way to do this (if possible with detailed comments, I hope this will be useful to many).
Accepted answer
Comments
I think the function you actually want is hook_html_head_alter
Something like:
function theme_name_html_head_alter(&$head_elements){
$head_elements['viewport']['#attributes']['content'] .= ', user-scalable=no';
}
This adds it to the existing content of the viewport meta tag.
Please tell me where I can get understandable training information about these hooks for Template.php? The documentation is written for those who know what to do, it does not help me.
Hi Enthusiast.
A few things:
We are replacing one of the weekly meetings with a documentation meeting. You can see when the next one is. If you would like to attend that's great but you can also feed in your feedback and needs on documentation.
The schedule for next few meeting is here:
There was a recorded user group about using some hooks and while I don't think it covers the specific template hooks, you might find it useful.
https://www.youtube.com/live/Ds76p2go0rs?si=deNHJOJOICeZ5TON
The next Backdrop Live is on the 3rd - 4th April and there should be times that would be suitable for you whatever your timezone. If you would like a specific session around templating hooks, then ask and tell us your preferred time and we will try to accommodate you. Registration hasn't opened yet, but we'll be starting the planning next week.
Hope one or more of these avenues can be of help.
I think the function you actually want is hook_html_head_alter
Something like:
This adds it to the existing content of the viewport meta tag.