Opened 10 years ago

Closed 10 years ago

#3799 closed (fixed)

Lorem ipsum template tag

Reported by: Sascha Peilicke Owned by: Adrian Holovaty
Component: Template system Version: master
Severity: Keywords: Lorem ipsum, Template, Debug mode
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Hello, everybody knows the "Lorem ipsum ..." text usually used to test templates. Wouldn't it be good to have a django built-in variable which displays this text. I have to test lots of templates and pasting this text in and deleting later is silly work. You could use it if you declare some blocks in your "base.html" and fill them with "Lorem ipsum" per Default, so that everybody can see how a template looks and works. I think it would be best if this placeholder is only displayed in DEBUG-mode.

here is an example of what i mean:

<body>

{%block content %}{{ placeholder }}{{% endblock %}

</body>

instead of

<body>

{%block content %}content goes here{{% endblock %}

</body>

Attachments (1)

lorem_ipsum.patch (10.4 KB) - added by Chris Beaven 10 years ago.
with tests and docs

Download all attachments as: .zip

Change History (15)

comment:1 Changed 10 years ago by Gary Wilson <gary.wilson@…>

Triage Stage: UnreviewedDesign decision needed

FYI, there is a Lorem ipsum template tag posted on djangosnippets.org.

comment:2 Changed 10 years ago by Adrian Holovaty

Triage Stage: Design decision neededAccepted

I love it!

Changed 10 years ago by Chris Beaven

Attachment: lorem_ipsum.patch added

with tests and docs

comment:3 Changed 10 years ago by Chris Beaven

Triage Stage: AcceptedReady for checkin

comment:4 Changed 10 years ago by Chris Beaven

Has patch: set

Sounded fun, so I did it. Doesn't currently do the "only displayed in DEBUG-mode." request, so push it back if this was part of accepted decision.

comment:5 Changed 10 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [4847]) Fixed #3799 -- Added Lorem template tag for generation of random latin content. Thanks to SmileyChris for the implementation.

comment:6 Changed 10 years ago by Russell Keith-Magee

(In [4848]) Fixes #3799 -- Oops - ran last checkin from the wrong directory. Checked in the rest of the lorem templatetag implementation.

comment:7 Changed 10 years ago by anonymous

Still missing django.utils.lorem_ipsum

comment:8 Changed 10 years ago by Sascha Peilicke

Thanks everybody, exactly what I wanted

comment:9 Changed 10 years ago by Chris Beaven

Resolution: fixed
Status: closedreopened

Doesn't look like django.utils.lorem_ipsum was checked in. Can a committer fix this please?

comment:10 Changed 10 years ago by Adrian Holovaty

I'd prefer this tag to be in django.contrib rather than being a built-in tag. It's nice, but it's not fundamentally necessary. I'll make that change.

comment:11 Changed 10 years ago by Adrian Holovaty

Just an FYI for SmileyChris: In the attached patch, some of the functions in the lorem_ipsum.py module define variables whose names are the same as the functions themselves. Although it works, it's kinda sketchy, so I'm changing the internal variable names.

comment:12 in reply to:  9 Changed 10 years ago by Russell Keith-Magee

Replying to SmileyChris:

Doesn't look like django.utils.lorem_ipsum was checked in. Can a committer fix this please?

Bother. I didn't have a good night with this ticket... :-)

It looks like Adrian is picking up the ball on this one. I'll leave him to it.

comment:13 in reply to:  11 Changed 10 years ago by Chris Beaven

Replying to adrian:

... define variables whose names are the same as the functions themselves. Although it works, it's kinda sketchy...

Thanks, I'll avoid that in the future.

comment:14 Changed 10 years ago by Adrian Holovaty

Resolution: fixed
Status: reopenedclosed

(In [4857]) Fixed #3799 -- Added django.contrib.webdesign and moved 'lorem' template tag into there

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