0

I want to add an additional CSS class to my template which is located here:

app/design/frontend/default/ves_fashion/template/persistent/checkout/onepage/login.phtml

I am asking myself now what is the correct way in Magento?

Should I change the login.phtml in that directory above or should I create a duplicate of that login.phtml and add it to my own extension at: app/code/local/MyExtension/ShippingMethodExtension/Block/Checkout/Onepage/login.phtml

How can I then tell Magento that it should use the login.phtml of my extension and not the one from the persistent folder?

Would be great if someone can help me. Thanks!

0

Use a layout file for doing this:

<?xml version="1.0">
<layout>
    <default>
        <reference name="head">
            <action method="addItem"><type>skin_css</type><file>css/your.css</file></action>
        </reference>
    </default>
</layout>

Then in your config.xml you will have to reference this layout file:

<layout>
    <updates>
        <bla_login>
            <file>bla/login.xml</file>
        </bla_login>
    </updates>
</layout>
| improve this answer | |
  • Thanks for the quick answer - so no need for an extension? Where do I find the right element which I must put in "<bla_login"> ? – Torben Jun 4 '15 at 8:45
  • 1
    Yes, you should create an extension for this. then replace bla with your a name that suites you. I suggest that you read how to create an extension to have a better understanding of the config.xml and then for more specific check this nice tutorials to get a better idea of magento layouts: magebase.com/magento-tutorials/… and classyllama.com/blog/the-better-way-to-modify-magento-layouts – lloiacono Jun 4 '15 at 8:50
  • Hey thanks. I tried it - I understand the concept a bit better, but still there are some questions: I have a config.xml of my module which has some content starting with <content> because it is already rewriting a php file which has been added with an extension. after </content> is closed i added <frontend><layout>... from my themes checkout.xml I copied the <reference> tag and its contents which defines the login.phtml to my config.xml and changed the path of the template. But nothing changes. Do you have another hint for me? – Torben Jun 4 '15 at 9:44
  • Every time you change your config.xml flush the cache to see the changes – lloiacono Jun 4 '15 at 9:48

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.