ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Magento​Snippets

by MageFront ST2/ST3

Magento Front End Snippets, plugin for Sublime Text

Details

Installs

  • Total 4K
  • Win 2K
  • OS X 902
  • Linux 908
Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5
Windows 0 0 0 1 3 1 0 0 2 0 0 2 0 2 1 1 0 2 1 1 3 1 0 2 0 1 1 1 1 2 2 0 0 2 1 2 3 0 0 1 2 0 1 2 0 2
OS X 0 1 2 0 0 2 0 0 0 0 1 0 0 0 2 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 2 1 1 1 0 0 1 0 1 0 0 0
Linux 0 3 0 1 1 0 0 0 0 1 0 0 0 0 2 1 0 0 2 0 1 3 1 0 0 0 0 0 1 0 0 0 2 0 0 1 0 0 0 1 0 2 1 2 0 0

Readme

Source
raw.​githubusercontent.​com

MagentoSnippets

Magento Front End Snippets, plugin for Sublime Text.

This tool serves to aid the productivity during the Magento's theme development through snippets. These snippets brings partial codes belonging the Magento framework. These code that we used everyday, but never memorized because they are often complex and lengthy.

Installation

Install via Package Control

How do I use it?

The tab trigger of this plugin is “mg-*”.

In some editors just the tab key don't trigger the snippet, so you have to check few things to make magic happens like on gif below.

  1. Check if you don't have set key binding for user (if so you have to remove it):

    { "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },

  2. If it still doesn't work add to your user settings below line:
    "tab_completion": false,

  3. Some people have assigned CTRL+Space as the snippet trigger

  4. Check if another package is not coliding with snippet trigger (i.e. Emmet can cause some issues with Sublime Text 3 Snippet usage)

MagentoSnippets: example of use

Suggestions

If you have something to improve these snippets, please create a issue

For how to do your own snippet and contribute for this tool see the contribution text

Available Snippets

XML

  1. mg-addLinkRel :: Add LinkRel in XML
  2. mg-xml-cms-block :: CMS Block in XML
  3. mg-xml-css :: Adds CSS in XML
  4. mg-insert :: Insert block Method
  5. mg-local-xml :: Writes the basic structure to a new local.xml file
  6. mg-ref :: Add reference tag
  7. mg-rm :: XML to removes a block
  8. mg-removeItem :: Remove head items by xml
  9. mg-xml-setcolumn :: Add number of columns in product list
  10. mg-set-template :: Action to set a new root template
  11. mg-xml-skinjs :: Add skin js in XML
  12. mg-unsetchild :: Unset Child Method
  13. mg-xml-text :: Free text in XML

PHTML

  1. mg-php-cms-block :: CMS Block in PHTML(PHP+HTML)
  2. mg-format-price-currency :: Format Price
  3. mg-getAttrText :: Get Attribute Text in product view
  4. mg-getchildhtml :: Get Child Html Method
  5. mg-url :: Get Url
  6. mg-url-asec :: Get Array Secure Url
  7. mg-img :: Image Skin Url
  8. mg-productTypeId :: Get Type Product Id
  9. mg-script :: Adds script/javascript tag
  10. mg-storeInfo :: Gets store information
  11. mg-translate-phtml :: Adds the translator helper output
  12. mg-vars :: Get Variable from admin
  13. mg-viewport :: Viewport metatag to load media-queries

JS

  1. mg-console-log :: Add console.log for debug
  2. mg-iife-jquery :: IIFE passing jQuery as parameter
  3. mg-prototype-dom-ready :: Adds Prototype DOM ready

SCSS

  1. mg-clearfix :: Creates a placeholder selector to fix floats
  2. mg-scss-imgurl :: Calls the image url function
  3. mg-scss-sprite-height-width :: Calls in scss sprite height and width functions
  4. mg-scss-sprite :: Calls in scss the Sprite function