- Name: hook_assign_block_vars
- Rationale: This hook will allow someone to filter/add to a specified assign_block_vars allowing addition of vars in a specific loop.
- Placement: includes/template.php
- Input arguments: $block_name, $vararray = array(), $args = array()
- Output format: array
- Output semantics: Returns the array for $block_name
- Infrastructure: This would allow hooking into any templates block_vars array with ease and without editing core files or other mods.
[RFC] hook assign_block_vars
[RFC] hook assign_block_vars
- Erik Frèrejean
- Registered User
- Posts: 207
- Joined: Thu Oct 25, 2007 2:25 pm
- Location: surfnet
- Contact:
Re: [RFC] hook assign_block_vars
I might miss something, but this sounds like template::alter_block_array. I'm not sure what advantage this hook will bring over alter_block_array.
Available on .com
Support Toolkit developer
Support Toolkit developer
- nickvergessen
- Former Team Member
- Posts: 733
- Joined: Sun Oct 07, 2007 11:54 am
- Location: Stuttgart, Germany
- Contact:
Re: [RFC] hook assign_block_vars
With the hook you don't need to edit the core, else you need to edit the core and add your alter statement somewhere.
Member of the Development-Team — No Support via PM
Re: [RFC] hook assign_block_vars
I believe a better approach would be to hook the arrays before they enter that function. You have a better understanding of what data is going in, and you don't need to detect what's going into assign_block_vars
Re: [RFC] hook assign_block_vars
I have deleted this and posted in: [3.1/Ascraeus] Hook Location Requests viewtopic.php?f=111&p=218361#p218361
Last edited by Michaelo on Mon Jan 10, 2011 7:33 am, edited 3 times in total.
Mods: Forum Icons Enhancement, Kiss Portal Engine
Links: Kiss Portal Engine (dev site) Stargate Portal (archive site) ...
Styles: Technika
Links: Kiss Portal Engine (dev site) Stargate Portal (archive site) ...
Styles: Technika
Re: [RFC] hook assign_block_vars
Consider the following... (viewtopic.php code ref: Check sticky/announcement time limit)
Simplified version, assume core code:A mod edit would result in:How would this be handled with hooks?
Simplified version, assume core code:
Code: Select all
if ($topic_data['topic_type'] == POST_STICKY)
{
... some code including an sql query ...
}
Code: Select all
if ($topic_data['topic_type'] == POST_STICKY || $topic_data['topic_type'] == MOD_VAR)
{
... somecode including an sql query ...
}
Mods: Forum Icons Enhancement, Kiss Portal Engine
Links: Kiss Portal Engine (dev site) Stargate Portal (archive site) ...
Styles: Technika
Links: Kiss Portal Engine (dev site) Stargate Portal (archive site) ...
Styles: Technika