Plugin hooks in theme

Post Reply
cobber
Ssr. Bludit
Posts: 13
Joined: Sun Feb 28, 2016 10:15 am

Have been reading the documentation and would like to know what the hook ''siteHead, 'siteBodyBegin' and 'siteBodyEnd' relate to. The documentation says "contains all the plugins" . . . can someone explain what they mean by 'all the plugins'
User avatar
Edi
Site Admin
Posts: 2594
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

cobber wrote: Fri Apr 02, 2021 2:11 pm Have been reading the documentation and would like to know what the hook ''siteHead, 'siteBodyBegin' and 'siteBodyEnd' relate to.
You can see for example the default theme Alternative:

https://github.com/bludit/bludit/blob/m ... /index.php
The documentation says "contains all the plugins" . . . can someone explain what they mean by 'all the plugins'
Where is this written?
Gumroad - Useful plugins for Bludit | Nützliche Plugins für Bludit
Planet-Bludit - Tipps, Snippets und hilfreiche Links (auf Deutsch)
cobber
Ssr. Bludit
Posts: 13
Joined: Sun Feb 28, 2016 10:15 am

Morning ,

It's located in the page https://docs.bludit.com/en/themes/examp ... cond-theme

Under the heading 'Add plugin support'

Was trying to understand siteHead and what it returns when I include it in a page.
I do see that siteHead returns the following tag:

<link rel="canonical" href="bahbahbahetc" />

Will investigate the following too:

siteBodyBegin and siteBodyEnd


Thanks
lightmat
Sr. Bludit
Posts: 46
Joined: Fri Feb 21, 2020 10:53 pm

All plugins have different functionality, so the different plugins are designed to appear in a specific place in the theme. e.g. sitehead, sidebar, footer, etc. This is what hooks are for, to hook into the place in the theme where it should appear.
See the code in various plugins, then you will see a function that tells where the plugin belongs in the theme (hook)
e.g. plugin "canonical" has the function:
public function siteHead(), which specifies that the output should be in the sitehead between the HTML tag <head> </head>, so all plugins with the function siteHead() will have output in that place.
Post Reply