Opened 15 years ago

Closed 15 years ago

Last modified 12 years ago

#11689 closed Uncategorized (fixed)

Template tag to support combining form media from multiple forms

Reported by: Bradley Ayers Owned by: nobody
Component: Template system Version: 1.1
Severity: Normal Keywords:
Cc: Jari Pennanen Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I suggest that a template tag be added that has the ability to combine the media of multiple forms within a template. This would allow someone to have multiple forms (each having similar media), without having duplicate tags added to the template output (when printing the combined form media).

Currently, the programmer would have to manually add the media within a view, and then pass the result through in a template context, in order to achieve the 'unique union' result. While browsers would not be 'dumb' enough to request the same media multiple times, I would expect that the browser should execute the contents of each file, once for each time it has been included with a script or link tag (I imagine that this could cause very undesirable side-effects, i.e. a javascript file which adds a function as an event listener each time the script is execute)

Change History (7)

comment:1 by Chris Beaven, 15 years ago

Triage Stage: UnreviewedAccepted

If #11687 lands (including the part supporting using the |add filter for non-integers), then this will be a non-issue.

But since that hasn't been accepted yet, I'll accept this.

comment:2 by Jari Pennanen, 15 years ago

Cc: Jari Pennanen added

in reply to:  1 ; comment:3 by Jari Pennanen, 15 years ago

Replying to SmileyChris:

If #11687 lands (including the part supporting using the |add filter for non-integers), then this will be a non-issue.

If I understood right, the add filter can only add two items together, usually there are several forms and medias... It would be better to have own tag for this, so one can add several medias together not just two.

in reply to:  3 comment:4 by Chris Beaven, 15 years ago

Replying to Ciantic:

If I understood right, the add filter can only add two items together, usually there are several forms and medias... It would be better to have own tag for this, so one can add several medias together not just two.

Uh, you realize you can just chain the add filter?

comment:5 by James Bennett, 15 years ago

milestone: 1.2

1.2 is feature-frozen, moving this feature request off the milestone.

comment:6 by Chris Beaven, 15 years ago

Resolution: fixed
Status: newclosed

Actually, may as well just mark as fixed in [12497]

comment:7 by Simon Litchfield, 12 years ago

Easy pickings: unset
Severity: Normal
Type: Uncategorized
UI/UX: unset

What we really need, is a form/formset "binder" of some sort, so we don't have to hack dodgy stuff like this into our templates (cleans up a whole bunch of other uglies like combining errors etc too).

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