CityWebConsultants / Iris

Modular content management and web application framework built with Node.js and MongoDB
http://irisjs.org
Other
9 stars 7 forks source link

fix(navigation tags ranking) #208

Closed alexbor closed 8 years ago

alexbor commented 8 years ago

Not sure why the tags are in the structure:

tags {
 attr{
     tagName{
      }
  }
}

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.

tags {
 attr [
     { tag: tagName, etc}
  ]
}

Signed-off-by: Alex Bor alexhbor@gmail.com

FilipNest commented 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.

alexbor commented 8 years ago

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.

FilipNest commented 8 years ago

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?

alexbor commented 8 years ago

I did try, but the rank was ignored when I did.

FilipNest commented 8 years ago

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.