django-pattern-library icon indicating copy to clipboard operation
django-pattern-library copied to clipboard

Usage examples in the documentation

Open gjost opened this issue 5 months ago • 2 comments

I do mostly back-end development. My organization hired somebody to do visual design for a site and they are delivering their work in the form of a set of django-pattern-library templates. Using the documentation site (https://torchbox.github.io/django-pattern-library/) I've been able to install django-pattern-library and I can see their work in /pattern-library/. It looks very nice.

My problem is that it is not obvious how to actually use these pattern templates in my project. I think I figured out that you {% include %} the templates and pass in one or more objects:

{% include "patterns/components/image_block.html" image=img, caption=imgcaption, url=imgurl %}

It's quite possible that this is not what you do and I don't actually understand it!

I found this in the code snippet under the "Document your patterns" section of Usage Tips. The django-pattern-library documentation contains hardly any examples of usage, or maybe it does but it's not obvious that these are different from the examples of writing pattern templates themselves.

I would like to see at least a short example at the bottom of the "Getting Started" page, as well as a more detailed "Using DPL In Your DJango Site" page.

gjost avatar May 07 '25 23:05 gjost