5/30/2010

Enable Template Path Hints in Magento

Template Path Hints is the one of the most Use full Feature in Magento for the Magento Developer and Designer .It Helps to show the Phtml file's path.For example:- if you want to Modify header of a Magento template then Template Path Hints will help you to find the actual location where the Phtml file located. To show the Template Path Hints you need to
log in to the admin panel of your Magento site
Go to System tab ->From the drop down select Configuration
select Main website from the left top Current Configuration Scope
scroll down towards footer there you will find Developers -> Click on it and again scroll up to wards Header.
Expand the Debug Tab
Set Template Path Hints to Yes. Now got to your Frontend and refresh your page You will see all the path hints of your template

5/11/2010

How to add Javascript or Css file into Magento

By default there already some css and Javascript file included in the page.xml. If you want to add some more new css file then write

<action method="addCss"><stylesheet> css/Yourcss.css </stylesheet> </action>

into the page.xml which is inside Your app/design/Frontend/base/default/layout/Page.xml (in Magento 1.4.0.0 or Higher version of Magento). If you want to add a javascript then you can directly write that code into your header.Phtml file which is in the app/design/frontend/base/default/template/page/html/header.phtml .Open the file and write

<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/yourjs.js')?>"></script>

and upload/paste your js into Skin/frontend/default/default/js Folder.