Opened 19 years ago

Closed 19 years ago

Last modified 18 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

Description

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@… 19 years ago.

Download all attachments as: .zip

Change History (6)

by jens@…, 19 years ago

Attachment: user_taglibs.patch added

comment:1 by Jacob, 19 years ago

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 by jens@…, 19 years ago

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 by anonymous, 19 years ago

Resolution: worksforme
Status: assignedclosed

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

comment:4 by Jacob, 19 years ago

Resolution: worksforme
Status: closedreopened

Reopening since I still should document how this works :)

comment:5 by Adrian Holovaty, 19 years ago

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