Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Custom smarty function
martin28
New
Hi Team,
I cloned custom theme which needs custom search. The cloned theme only have the default.master.tpl (no default.master.php).
Basically, I want to add custom search in the default.master.tpl & I found from library/SmartyPlugins/function.searchbox.php where if I add another function (ex. function.custom_searchbox.php) in the same directory & call it in default.master.tpl, it works. Now I want to move that new function.custom_searchbox.php in the theme directory & be able to call the custom function in the theme default.master.tpl. Is this possible?
I stumbled upon Gdn_Smarty_init_handler which I could not execute properly. Any hep will be appreciated.
TIA
0
Comments
That is already the answer! You have to add this method to your ThemeHooks file and maybe you need to clear the
/cache/theme
folder before your changes take effect.See here for a discussion on this topic: https://open.vanillaforums.com/discussion/27767/how-to-create-custom-smarty-functions
Thank you so much @R_J