Plugin hooks in theme

Post Reply
User avatar
cobber
Master Bludit
Posts: 78
Joined: Sun Feb 28, 2016 10:15 am
Location: Scotland
Has thanked: 21 times
Been thanked: 5 times

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: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
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?
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
cobber
Master Bludit
Posts: 78
Joined: Sun Feb 28, 2016 10:15 am
Location: Scotland
Has thanked: 21 times
Been thanked: 5 times

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