Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8003951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:47:18+00:00 2026-06-04T16:47:18+00:00

In Magento, how to add js or css file in custom two column left

  • 0

In Magento, how to add js or css file in custom two column left page using page.xml file.

I am using the following code in page.xml at line:168

<page_two_columns_left translate="label">
  <label>All Two-Column Layout Pages (Left Column)</label>  
  **<reference name="head">
    <action method="addJs"><script>sidebar_menu.js</script></action>
    </reference>**
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-left.phtml</template>  </action>
        <!-- Mark root page block that template is applied -->
        <action method="setIsHandle"><applied>1</applied></action>
    </reference>
</page_two_columns_left>

I can use the js/css by putting it in 2column-left.phtml but I don’t thing it is convenient way. I want to add using xml.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:47:19+00:00Added an answer on June 4, 2026 at 4:47 pm

    Are the two asterisks up there actually on your code? If not, basically what you’re doing there is correct. however:

    <handle>
        <reference name="head">
            <action method="addJs"><script>prototype/prototype.js</script></action> <!-- adds a js referencing to the /js directory -->
            <action method="addCss"><stylesheet>css/custom.css</stylesheet></action> <!-- adds CSS looking at the skin/ directories ( in reverse order: base/default, default/default, default/yourtheme, yourpackage/yourtheme -->
            <action method="addItem"><type>skin_js</type><name>js/custom_script.js</name><params/></action> <!-- adds a js at the skin/ directories in the same manner as the above addCss directive -->
        </reference>
    <handle>
    

    Please note that can be replaced by either default,modulename_controller_action e.g catalog_cart_index or in your case, page_two_columns_left

    It is best to modify local.xml instead found inside app/design/frontend/yourpackage/yourtheme/layout/ if you have a custom skin to work with.

    As much as possible, please don’t touch page.xml inside the app/design/frontend/base/default/layout/ directory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am able to add custom links to Magento's top.links with the following code
Have had no luck trying to add a reference to a custom.css file to
I want to add some CSS files to a product detail page in magento
I am using Magento var-1.6 I need to add a new template(.html) file to
i'm trying to add some custom attributes to the checkout(sales) page of magento 1.5.1.0
![1062 Duplicate entry][2] In Magento's Product creation code, I add my own custom code
I am struggeling with Magento custom options. In Magento you can add custom options
I am using Magento for my online store. Now i need to add a
I'm using Magento Community Edition ver. 1.6.2.0. I’m trying to add a Simple product
How can I add Magento's default newsletter signup module within a CMS page? Thanks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.