Plugin hooks in theme
- 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'
- Edi
- Site Admin
- Posts: 3121
- Joined: Sun Aug 09, 2015 5:01 pm
- Location: Zurich
- Has thanked: 54 times
- Been thanked: 78 times
- Contact:
You can see for example the default theme Alternative:
https://github.com/bludit/bludit/blob/m ... /index.php
Where is this written?The documentation says "contains all the plugins" . . . can someone explain what they mean by 'all the plugins'
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
- 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
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
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.
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.