Closed alexbor closed 8 years ago
I think this is there to allow quick rewriting through other hooks rather than having to find the specific index. Why do you need to reorder attributes? Where does the order matter? Also makes it easier to print out the specific attribute if doing it in custom theming.
When putting scripts on the page it's incredibly important the order that they go in, which is why rank was there it just wasn't used.
If a script requires another to be loaded first, for example jQuery, plugins etc, they will need to be higher up on the page.
Sorry, I thought you meant attributes. Tags certainly have to be in an order, I thought this already happened. Here's an example of one being defined:
variables.tags.headTags.jqueryuiCSS = {
type: "link",
attributes: {
"href": "/modules/forms/jsonform/deps/opt/jquery.ui.custom.css",
"rel": "stylesheet"
},
rank: 5
};
The rank should deal with this. Does it not?
I did try, but the rank was ignored when I did.
OK, something must be broken then. If this fix makes the tags work, still allows you to overwrite them and makes rank work that sounds fine then.
Not sure why the tags are in the structure:
Inside attr I would have it as an array not an object, but that's just a suggestion instead of needing to do a hacky fix for ordering the items.
Signed-off-by: Alex Bor alexhbor@gmail.com