Tuesday 30 June 2015

How to make a magento directory structure for publishing a extension with JS

In Magento, if you want to publish an extension after having developed it, it's quite complicated and boring to copy the files to a separate folder and zip it as the following, but it's a have-to-do thing.

Create the extension folder: 

mkdir ~/tmp/yourcompany_yourmodule

Copy the module's php code and configuration under app/code folder

mkdir ~/tmp/yourcompany_yourmodule/app/code/local/Yourcompany -p
cp -r app/code/local/Yourcompany/Yourmodule ~/tmp/yourcompany_yourmodule/app/code/local/Yourcompany/

Copy the module's layout files under app/design folder




mkdir ~/tmp/yourcompany_yourmodule/app/design/frontend/rwd/default/layout -p
cp app/design/frontend/rwd/default/layout/yourcompany_yourmodule.xml ~/tmp/yourcompany_yourmodule/app/design/frontend/rwd/default/layout/


Copy the main configuration under app/etc folder

mkdir ~/tmp/yourcompany_yourmodule/app/etc/modules -p
cp app/etc/modules/Yourcompany_Yourmodule.xml ~/tmp/yourcompany_yourmodule/app/etc/modules/

Copy the js files under js folder

mkdir ~/tmp/yourcompany_yourmodule/js/yourcompany -p
cp -r js/yourcompany ~/tmp/yourcompany_yourmodule/js/
note: the js files should be added in the layout xml files

No comments:

Post a Comment