Opened 17 years ago

Closed 17 years ago

#4984 closed (wontfix)

Want support for conditional links in templates

Reported by: daniel@… Owned by: Adrian Holovaty
Component: Template system Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

First off -- thanks for Django, it's spectacularly awesome.

One small thing that would improve my life greatly:
Right now, I have a linkbar generated with '<a href="{% url one %}">one</a> <a href="{% url two %}">two</a> <a href="{% url three %}">three</a>', etc. However, I would like this to not generate links to the current page: i.e., if I'm already on two, I want one and three to be links, and two to just be plain text. A filter like '{% cond_url_link some.app.here one %}', maybe with an optional style class or so, that generates the entire link struct for me: <a href="/url/here/">desc</a> if it's a different page, but just the description if we're already on that same page.

Thanks again!

Change History (1)

comment:1 by Simon G. <dev@…>, 17 years ago

Resolution: wontfix
Status: newclosed

Have you tried a custom template tag, specifically an inclusion tag?

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