[ckan-dev] Overriding helper functions?

Koebrick, Andrew (MNIT) andrew.koebrick at state.mn.us
Wed Jan 28 19:52:12 UTC 2015


Is it possible to override a template helper function in an extension?  I have a functional rewrite of the follow_button helper (it calls a new snippet when users are not logged in, prompting them to create an account).  I was hoping to just name it the same as the existing follow_button so that I would not have to rewrite the existing templates to point to the new function.  I see this warning in get_helpers:
# Template helper function names should begin with the name of the
        # extension they belong to, to avoid clashing with functions from
        # other extensions.
But is this just good form, or can I somehow have a helper with the same name as a stock helper, but have mine called instead.  I have tried, but I get errors when using the same name...  Any tricks to let me avoid rewriting templates?


Andrew Koebrick  |  MINNESOTA GEOSPATIAL INFORMATION OFFICE
Web Coordinator / Systems administrator / Librarian
MN.IT Services @ CENTRAL
651-201-2465 (w)  |   651-296-6398 (f) |  andrew.koebrick at state.mn.us<mailto:andrew.koebrick at state.mn.us>
658 Cedar St., Room 300, St. Paul, MN 55155, www.mngeo.state.mn.us<http://www.mngeo.state.mn.us/>

[cid:image002.jpg at 01CE61F8.52552AE0]<http://www.mn.gov/oet>

Information Technology for Minnesota Government   |   mn.gov/oet<http://www.mn.gov/oet>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20150128/f326005e/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 1624 bytes
Desc: image001.jpg
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20150128/f326005e/attachment-0002.jpg>


More information about the ckan-dev mailing list