1

I am trying to add some additional css/js to the 3columns.phtml page. First I have tried to add it in page.xml page app/design/frontend/mytheme/layout/page.xml

My code is

<page_three_columns translate="label">
        <label>All Three-Column Layout Pages</label>
        <reference name="root">
            <action method="setTemplate"><template>page/3columns.phtml</template></action>
            <!-- Mark root page block that template is applied -->
            <action method="setIsHandle"><applied>1</applied></action>
            <action method="setLayoutCode"><name>three_columns</name></action>
        </reference>
        <reference name="head">
            <action method="addItem"><type>skin_css</type><name>css/bootstrap/bootstrap.css</name></action>
            <action method="addItem"><type>skin_css</type><name>css/bootstrap/bootstrap.min.css</name></action>
            <action method="addItem"><type>skin_js</type><name>js/bootstrap/bootstrap.js</name></action>
        </reference>
    </page_three_columns>

But there was no change at the 3columns.phtml pages.Then I add the css/js files only at the catelog product view page, but no change. my default local.xml file

<catalog_product_view translate="label">
        <reference name="root">
            <action method="setTemplate">
                <template>page/3columns.phtml</template>
            </action>
        </reference>
        <reference name="head">
            <action method="addItem"><type>skin_css</type><name>css/bootstrap/bootstrap.css</name></action>
            <action method="addItem"><type>skin_css</type><name>css/bootstrap/bootstrap.min.css</name></action>
            <action method="addItem"><type>skin_js</type><name>js/bootstrap/bootstrap.js</name></action>
            <action method="addItem"><type>skin_js</type><name>js/bootstrap/bootstrap.min.js</name></action>
        </reference>
    </catalog_product_view> 

So Please tell me..Is that a correct way.. Is that any format to add js/css files at basic pages.. Please guide me

  • 1
    Your code looks ok to me. Have you cleaned your cache? And have you applied your catalog to 3 columns? – Adarsh Khatri Jun 10 '15 at 7:55
  • Yes i did...but no change.. – Gayathri Jun 10 '15 at 8:01
  • What's the url? if you have it live. – Adarsh Khatri Jun 10 '15 at 8:02
  • Also are you editing pag.xml from your path/to/your/theme/layout/? – Adarsh Khatri Jun 10 '15 at 8:04
  • Sorry @Adarsh Khatri.. Now i am trying at localhost..... – Gayathri Jun 10 '15 at 8:05
1

Ok so you are likely getting error on your package directory-

It should be-

app/design/frontend/my_package/my_theme/layout/page.xml 

and same thing in skin folder -

skin/frontend/my_package/my_theme/css
skin/frontend/my_package/my_theme/js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.