Giter VIP home page Giter VIP logo

itemposition's Introduction

Dh_ItemPosition

Small module to provide very basic sorting ability for included head files (css and js) in Magento.

Will be most useful when including items from local.xml but can be used anywhere where the ordering of two or more files is important.

The module requires a rewrite of Mage_Page_Block_Html_Head

Usage

Three new methods have been added to Mage_Page_Block_Html_Head:

  1. setFirstItem - Make an item the first of its parent type (js or css) to be included
  2. setLastItem - Make an item the last of its parent type (js or css) to be included
  3. setBefore - takes two parameters and ensures that one will always be included before/after the other
    <reference name="head">
            <action method="setBefore">
                <before>js/lib/jquery/jquery/jquery-1.8.2.min.js</before>
                <target>js/lib/jquery/depends-on-jquery.js</target>
            </action>
     </reference>

or
     <reference name="head">
            <action method="setFirst">
                <first>js/lib/jquery/jquery/jquery-1.8.2.min.js</first>
            </action>
     </reference>


or

     <reference name="head">
            <action method="setLast">
                <last>js/lib/jquery/depends-on-jquery.js</last>
            </action>
     </reference>

Support or Contact

Direct any feedback to @ddh__ / [email protected]

Changelog

1.0.0 Initial commit

1.1.0 Simplified Dh_ItemPosition_Block_Page_Html_Head::before. Additionally, this now ensures that the before item will always come directly before the after item

itemposition's People

Contributors

drewdhunter avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.