Opened 10 years ago

Closed 10 years ago

Last modified 9 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: UI/UX:


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

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by jens@…

comment:1 Changed 10 years ago by jacob

  • Owner changed from adrian to jacob
  • Status changed from new to assigned
  • Summary changed from Patch to allow for user-defined taglibs to Document 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 10 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 10 years ago by anonymous

  • Resolution set to worksforme
  • Status changed from assigned to closed

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 10 years ago by jacob

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Reopening since I still should document how this works :)

comment:5 Changed 10 years ago by adrian

  • Component changed from Template system to Documentation
  • Resolution set to invalid
  • Status changed from reopened to closed

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