Item2095: Add flexibility to ADDTOHEAD
Priority: Enhancement
Current State: Confirmed
Released In: n/a
Target Release: minor
Applies To: Engine
Component: ADDTOZONE
Branches:
We are having some practical problems with
ADDTOHEAD
, see
Item2066. The parameter
requires
does not allow to insert blocks before/in between other blocks.
Solution:
- add params
before
and after
--
ArthurClemens - 18 Sep 2009
I have had a need for a feature like this in my own work (making something load before TMCE).
I have some other ideas and concerns regarding ADDTOHEAD as a piece of infrastructure for skins and plugins though... but I'll work that up in the Development web one day.
--
PaulHarvey - 13 Dec 2009
is this still needed with the changes for
ZonePlugin and the rest?
--
WillNorris - 03 Apr 2010
No. Custom zones could be a way to get JS in front of all the other added parts, but within a zone you still want the ability to go before certain .js files. We still need a
before
param.
--
PaulHarvey - 04 Apr 2010
Surely the
requires
param of
ADDTOZONE addresses this? Assuming all
ADDTOZONE calls have a tag, that is.
Marking for Paul's feedback, since he seems to understand....
--
CrawfordCurrie - 24 Jun 2010
The
requires
param only caters for where you want to ensure something
follows a tag. It does not help when you want something
prior to the tag.
For example, some jquery libs (it's been a while, but superfish I think) will use different initialisation code-paths depending on presence of other plugins. In the case of superfish, I seem to recall that it will look for and magically make use of supersubs and hoverintent.
On one hand: we do not want superfish to
always require supersubs/hoverintent, because they may be superfluous to a particular application. On the other hand, there's no other way for a Foswiki dev to ensure that these are inserted before the
superfish.js
other than to hack the superfish dependency, maybe with a new mysuperfish plugin.
In reality, superfish has ways for a dev to force re-initialisation or otherwise manually invoke the plugin on DOM elements with forced params to use the extra plugin functionality; still, it seems like we're missing a feature here.
I'm making this confirmed, but with enhancement priority.
--
PaulHarvey - 24 Jun 2010