Monthly Archives: May 2013

Magento

How to Merge JavaScript Files and CSS Files In Magento?

Hello friends today I write a post regarding How to Merge JavaScript Files and CSS Files In Magento?For that you have to follow steps

Step 1 : Open your Magento admin panel dashboard.

Step 2 : Now go to the System menu >> Configuration. Click on that.
magento Admin Panel

Step 3 : Then go to Developer section and  look at debug section as below.

merge Css and Js

Select the both option to yes and you merge the css and js. on this wau you can speed up your site.

Advertisements

How do I turn on template path hints in magento?

Hello friends today I write a post regarding How do I turn on template path hints in magento? For that you have to follow steps

Step 1 : Open your Magento admin panel dashboard.

Step 2 : Now go to the System menu >> Configuration. Click on that.
magento Admin Panel

Step 3 : Then go to Developer section and  look at debug section as below.magento configurationStep 4 : Now you can see that here is not any option regarding “Template Path Hints“. For that you have to change the Current Configuration Scope of your site .

Go to the left end side and  you see on dropdown and then change as per below.
Current Configuration Scope

Step 5 : The page is reload automatically when you click on that once. and you see the below page. Select the Yes and click on save config button. Go to your front side and you can see the Template Path Hints.

Template Path Hints

Hope you like this. 🙂 🙂

Magento

How to Include Custom CSS and JS files On to All Product Pages in Magento?

Hello friends today I write an article on How to include Custom CSS and JS file on All Product Pages in Magento?

In magento it’s very easy to add our custom CSS and JS file. You didn’t add the tag for CSS and JS file to add in all pages rather than you have to just add that thing in your .xml file as I show below.

Step 1 : First find that  in your custom theme’s layout folder the local.xml file exists or not. If local.xml file is not created in your custom theme layout folder then just create as below.

<?xml version="1.0"?>
<layout>
</layout>

Step 2 : Now you created local.xml file and we add the CSS file from the skin CSS folder.

<?xml version="1.0"?>
<layout>
     <catalog_product_view>
          // this is a reference so it will add this in header part.
           <action method="addCss">// this is action for add css file
                 <stylesheet>
                           css/custom.css /*This is ur css path*/
                 </stylesheet>
              </action>
         </reference>
     </catalog_product_view>
</layout>

Now we try to add JavaScript file from the skin JS folder.

<?xml version="1.0"?>
<layout>
     <catalog_product_view>
         <reference name="head">
             <action method="addItem">
                   <type>skin_js</type>
                   <name>js/customJs.js</name>
              </action>
         </reference>
     </catalog_product_view>
</layout>

Now we try to add JavaScript file from the /js folder.

<?xml version="1.0"?>
<layout>
     <catalog_product_view>
         <reference name="head">
             <action method="addJs">
                   <script>myJs.js</script>
              </action>
         </reference>
     </catalog_product_view>
</layout>

Thanks for view this article.