MyBB Community Forums

Full Version: Template Hooks
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Something i would really like to see in MyBB 2.0 is Template Hooks, so when a plugin is made we can just hook right into a template rather then having to do a find replace sort of thing.
(2011-11-26, 10:00 AM)ChrisR Wrote: [ -> ]Something i would really like to see in MyBB 2.0 is Template Hooks, so when a plugin is made we can just hook right into a template rather then having to do a find replace sort of thing.

YES! That would really make life a good deal easier, so I'd love to see some kind of system like this.
(2011-11-26, 10:54 AM)euantor Wrote: [ -> ]
(2011-11-26, 10:00 AM)ChrisR Wrote: [ -> ]Something i would really like to see in MyBB 2.0 is Template Hooks, so when a plugin is made we can just hook right into a template rather then having to do a find replace sort of thing.

YES! That would really make life a good deal easier, so I'd love to see some kind of system like this.

In some ways you already can do this Toungue
But here's the thing...

What if I want to edit a part of the template that doesn't have one. And remove whats there?

"hooks" aren't going to work. Especially since some themes' templates are so far off from the standard that even the current find/replace style doesn't work.
(2011-11-26, 02:42 PM)Dylan M. Wrote: [ -> ]What if I want to edit a part of the template that doesn't have one. And remove whats there?

This. This goes for plugin hooks sometimes too, I want to do something but there aren't any hooks convinient.

Anyone up into looking into how Twig works in-depth?



(2011-11-26, 02:42 PM)Dylan M. Wrote: [ -> ]
(2011-11-26, 10:54 AM)euantor Wrote: [ -> ]
(2011-11-26, 10:00 AM)ChrisR Wrote: [ -> ]Something i would really like to see in MyBB 2.0 is Template Hooks, so when a plugin is made we can just hook right into a template rather then having to do a find replace sort of thing.

YES! That would really make life a good deal easier, so I'd love to see some kind of system like this.

In some ways you already can do this Toungue
But here's the thing...

What if I want to edit a part of the template that doesn't have one. And remove whats there?

"hooks" aren't going to work. Especially since some themes' templates are so far off from the standard that even the current find/replace style doesn't work.

Good points (ones that I hadn't considered), but it'd be really nice to have an easier way to modify templates. Even now I sometimes get myself confused with what should be such a basic task.

(2011-11-26, 02:47 PM)Paul H. Wrote: [ -> ]
(2011-11-26, 02:42 PM)Dylan M. Wrote: [ -> ]What if I want to edit a part of the template that doesn't have one. And remove whats there?

This. This goes for plugin hooks sometimes too, I want to do something but there aren't any hooks convinient.

Anyone up into looking into how Twig works in-depth?

I've looked into Twig in the past and it doesn't really offer anything as standard that I know of.
How do you get confused? Its a simple replacement following the preg_replace() syntax.
(2011-11-26, 04:27 PM)Dylan M. Wrote: [ -> ]How do you get confused? Its a simple replacement following the preg_replace() syntax.

I simply suck at regex Blush Always have done, no matter how hard I try to get my head round it.
I know it has it's issues, but I really like how IPB has its template hooks.

http://community.invisionpower.com/resou...hooks-r400