Code

Opened 5 years ago

Closed 4 years ago

Last modified 18 months ago

#11689 closed Uncategorized (fixed)

Template tag to support combining form media from multiple forms

Reported by: thepointer Owned by: nobody
Component: Template system Version: 1.1
Severity: Normal Keywords:
Cc: Ciantic 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)

Attachments (0)

Change History (7)

comment:1 follow-up: Changed 5 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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 4 years ago by Ciantic

  • Cc Ciantic added

comment:3 in reply to: ↑ 1 ; follow-up: Changed 4 years ago by Ciantic

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 4 years ago by SmileyChris

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 4 years ago by ubernostrum

  • milestone 1.2 deleted

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

comment:6 Changed 4 years ago by SmileyChris

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:7 Changed 18 months ago by simon29

  • Easy pickings unset
  • Severity set to Normal
  • Type set to 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).

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.