#288 closed enhancement (invalid)
Document custom template tags systyem
Reported by: | 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)
Change History (6)
by , 19 years ago
Attachment: | user_taglibs.patch added |
---|
comment:1 by , 19 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Summary: | Patch to allow for user-defined taglibs → Document custom template tags systyem |
comment:2 by , 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 , 19 years ago
Resolution: | → worksforme |
---|---|
Status: | assigned → closed |
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 , 19 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
Reopening since I still should document how this works :)
comment:5 by , 19 years ago
Component: | Template system → Documentation |
---|---|
Resolution: | → invalid |
Status: | reopened → 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.
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.