Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#288 closed enhancement (invalid)

Document custom template tags systyem

Reported by: jens@… Owned by: Jacob
Component: Documentation Version:
Severity: normal Keywords: taglibs
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


As far as I could see, there was no way to include userdefined taglibs into a django app except by extending django.templatetags. I might well have missed something, though. Be that as it may, I found it to be quickest to hack django.core.defaulttags to try and load taglibs from paths provided in TEMPLATETAG_DIRS in your config. I'll try to upload the patch here.

Attachments (1)

user_taglibs.patch (1.3 KB) - added by jens@… 15 years ago.

Download all attachments as: .zip

Change History (6)

Changed 15 years ago by jens@…

Attachment: user_taglibs.patch added

comment:1 Changed 15 years ago by Jacob

Owner: changed from Adrian Holovaty to Jacob
Status: newassigned
Summary: Patch to allow for user-defined taglibsDocument custom template tags systyem

There actually is: see the {% load %} tag, which looks in each installed app's "templatetags" directory. I'll have some docs on this up tonight, but until then you can check out the blog app in the djangoproject website.

comment:2 Changed 15 years ago by jens@…

Funny, the first thing I did was to try creating a "templatetags" directory, but that did not seem to work. I'll take a look at the blog app, though. Thanks!

comment:3 Changed 15 years ago by anonymous

Resolution: worksforme
Status: assignedclosed

Tried it again, this time it worked. Maybe I missed creating the in my first try. Forget the patch, and thanks for the help!

comment:4 Changed 15 years ago by Jacob

Resolution: worksforme
Status: closedreopened

Reopening since I still should document how this works :)

comment:5 Changed 15 years ago by Adrian Holovaty

Component: Template systemDocumentation
Resolution: invalid
Status: reopenedclosed

Closing this, because we have quite a bit of more documentation to write, and it's inefficient to open a ticket for each piece of documentation we need to write.

Note: See TracTickets for help on using tickets.
Back to Top