Name: hook_page_header
Rationale: The hook could be used to reduce edits for all mods, that need to load a language file globally or define a link in the overall_header.html
Placement: includes/functions.php
Input arguments: $page_title, $display_online_list, $item_id, $item
Output format: void
Output semantics: nothing
Related: A template-hook which you can use to add new links right next to the FAQ-Link: viewtopic.php?p=212631#p212631
[RFC|Implemented] page_header hook
- nickvergessen
- Former Team Member
- Posts: 733
- Joined: Sun Oct 07, 2007 11:54 am
- Location: Stuttgart, Germany
- Contact:
[RFC|Implemented] page_header hook
Member of the Development-Team — No Support via PM
- imkingdavid
- Registered User
- Posts: 1050
- Joined: Thu Jul 30, 2009 12:06 pm
Re: [RFC] page_header hook
I agree with this, especially that last bit about adding to the FAQ, Members, etc link area.
Re: [RFC] page_header hook
Yes, a lot of mods need to add a link to that menu.
Re: [RFC] page_header hook
This is great.
However, I think for loading scripts and CSS files a more elegant solution is needed. At the minimum, two hooks, for "before other scripts" and "after other scripts", but even better would be a load_phpbb_script() function where you could specify priority and dependencies (see WordPress' enqueue_script() for an example).
There are other hooks I would need in the header too -- the order is important. These are the hooks I would currently need:
hook_dtd (override the DTD)
hook_meta (override the meta or add new values)
hook_scripts_before
hook_scripts_after
in addition to the hook to add a link with the FAQ, etc. links.
However, I think for loading scripts and CSS files a more elegant solution is needed. At the minimum, two hooks, for "before other scripts" and "after other scripts", but even better would be a load_phpbb_script() function where you could specify priority and dependencies (see WordPress' enqueue_script() for an example).
There are other hooks I would need in the header too -- the order is important. These are the hooks I would currently need:
hook_dtd (override the DTD)
hook_meta (override the meta or add new values)
hook_scripts_before
hook_scripts_after
in addition to the hook to add a link with the FAQ, etc. links.
- Erik Frèrejean
- Registered User
- Posts: 207
- Joined: Thu Oct 25, 2007 2:25 pm
- Location: surfnet
- Contact:
Re: [RFC] page_header hook
This hook should also be capable to be used as an replacement of page_header, for example if you're trying to build an third party application around phpBB and need system calls like login_box() these functions call the page header. If in that case the actual page header is called, there might arise various issues with the third party application. There are ways to hack your way around this currently but it would be much nicer if you can simply override the phpBB page header with your own code.
Proposed change:
Proposed change:
nickvergessen wrote:Output format: void|bool
Output semantics: If the return format of the hook is "void" or "false", continue execution of the page header (as with the initial RFC). However if the return value is "true", do not execute the phpBB page header.Code: Select all
function page_header(....) { if ($phpbb_hook->result()) { return; }
Available on .com
Support Toolkit developer
Support Toolkit developer
Re: [RFC] page_header hook
great suggestion!
Re: [RFC] page_header hook
, i was going to post this suggestion ,I've already created this for my mods
Looking forward to 3.1
Looking forward to 3.1
Re: [RFC] page_header hook
I have this ledge in ledges-2: https://github.com/p/phpbb3/compare/dev ... 2Fledges-2 for my trivial css extension.
Template ledges do not have arguments, if they are needed this needs to be discussed somewhere.nickvergessen wrote: Input arguments: $page_title, $display_online_list, $item_id, $item
What you described for script loading is a good idea but it's off topic here.Jhong wrote:This is great.
However, I think for loading scripts and CSS files a more elegant solution is needed. At the minimum, two hooks, for "before other scripts" and "after other scripts", but even better would be a load_phpbb_script() function where you could specify priority and dependencies (see WordPress' enqueue_script() for an example).
What would you need this for? DTD is defined by the style.Jhong wrote:There are other hooks I would need in the header too -- the order is important. These are the hooks I would currently need:
hook_dtd (override the DTD)
Overriding meta would be a different ledge, adding meta you can do with the generic header ledge.Jhong wrote:hook_meta (override the meta or add new values)
Before and after what?Jhong wrote:hook_scripts_before
hook_scripts_after
Probably a different topic for these as well.Jhong wrote:in addition to the hook to add a link with the FAQ, etc. links.
This would be a different ledge.Erik Frèrejean wrote:This hook should also be capable to be used as an replacement of page_header, for example if you're trying to build an third party application around phpBB and need system calls like login_box() these functions call the page header. If in that case the actual page header is called, there might arise various issues with the third party application. There are ways to hack your way around this currently but it would be much nicer if you can simply override the phpBB page header with your own code.
- nickvergessen
- Former Team Member
- Posts: 733
- Joined: Sun Oct 07, 2007 11:54 am
- Location: Stuttgart, Germany
- Contact:
Re: [RFC] page_header hook
This topic is not about template hooksOleg wrote:Template ledges do not have arguments, if they are needed this needs to be discussed somewhere.nickvergessen wrote: Input arguments: $page_title, $display_online_list, $item_id, $item
nickvergessen wrote:...
Placement: includes/functions.php
...
Related: A template-hook which you can use to add new links right next to the FAQ-Link: viewtopic.php?p=212631#p212631
Member of the Development-Team — No Support via PM
Re: [RFC] page_header hook
https://github.com/p/phpbb3/commit/3498 ... 5d4ab7bad8 implements this and includes an override.
Formerly known as Unknown Bliss
No unsolicited PMs please except for quotes.psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"