Opened 18 years ago

Closed 18 years ago

#3799 closed (fixed)

Lorem ipsum template tag

Reported by: Sascha Peilicke Owned by: Adrian Holovaty
Component: Template system Version: dev
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: no UI/UX: no

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 18 years ago.
with tests and docs

Download all attachments as: .zip

Change History (15)

comment:1 by Gary Wilson <gary.wilson@…>, 18 years ago

Triage Stage: UnreviewedDesign decision needed

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

comment:2 by Adrian Holovaty, 18 years ago

Triage Stage: Design decision neededAccepted

I love it!

by Chris Beaven, 18 years ago

Attachment: lorem_ipsum.patch added

with tests and docs

comment:3 by Chris Beaven, 18 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Chris Beaven, 18 years ago

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 by Russell Keith-Magee, 18 years ago

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 by Russell Keith-Magee, 18 years ago

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

comment:7 by anonymous, 18 years ago

Still missing django.utils.lorem_ipsum

comment:8 by Sascha Peilicke, 18 years ago

Thanks everybody, exactly what I wanted

comment:9 by Chris Beaven, 18 years ago

Resolution: fixed
Status: closedreopened

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

comment:10 by Adrian Holovaty, 18 years ago

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 by Adrian Holovaty, 18 years ago

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.

in reply to:  9 comment:12 by Russell Keith-Magee, 18 years ago

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.

in reply to:  11 comment:13 by Chris Beaven, 18 years ago

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 by Adrian Holovaty, 18 years ago

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