Opened 7 years ago

Closed 7 years ago

Last modified 4 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 Changed 7 years ago by Chris Beaven

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
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 Changed 7 years ago by Jari Pennanen

Cc: Jari Pennanen added

comment:3 in reply to:  1 ; Changed 7 years ago by Jari Pennanen

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.

comment:4 in reply to:  3 Changed 7 years ago by Chris Beaven

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 Changed 7 years ago by James Bennett

milestone: 1.2

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

comment:6 Changed 7 years ago by Chris Beaven

Resolution: fixed
Status: newclosed

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

comment:7 Changed 4 years ago by Simon Litchfield

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