SimplePortal

Development => Feature Requests => Topic started by: Brettflan on January 11, 2011, 12:46:58 PM

Title: Use integrate_display_buttons hook instead of template edit
Post by: Brettflan on January 11, 2011, 12:46:58 PM
You have a modification to the Display.template.php file to add the "Add as Article" button. Rather than modify this template which is commonly changed in custom themes, in SMF 2.0 you can now use an integration hook to do it. The relevant hook in Display.template.php is called just above where you're currently inserting the button:
Code: [Select]
// Allow adding new buttons easily.
call_integration_hook('integrate_display_buttons', array(&$normal_buttons));

I suppose this isn't exactly a feature request, more like an improvement request. You likely already have plans to use hooks like this one, but I figured I'd ask just in case.
Title: Re: Use integrate_display_buttons hook instead of template edit
Post by: 130860 on January 11, 2011, 01:35:45 PM
many thanks Brettflan, is this one of the new RC4 hooks?

  I will let the Devs know about this since its definitely handy, at least for 2.0 users.
Title: Re: Use integrate_display_buttons hook instead of template edit
Post by: Brettflan on January 11, 2011, 01:51:48 PM
I just double-checked against the RC3 version of that file and you're correct, it is new with RC4. I just happened to notice it while setting up a test SimplePortal site and experimenting with other themes.
Title: Re: Use integrate_display_buttons hook instead of template edit
Post by: [SiNaN] on January 11, 2011, 03:51:53 PM
Being the one who revamped whole integration hook system in RC4 I'm aware of those. I could make SimplePortal work without any edits to core I guess. But we don't want to drop support for pre-RC4 installs yet and not all custom themes have those hooks.
SimplePortal 2.3.8 © 2008-2024, SimplePortal