2

How can I overwrite a layout file from admin? I am able to change template files but not layout files. I want to add in head jQuery because right now it is added after prototype and I have problems when merging js. I just want to add in main.xml from adminhtml to load first jQuery. I don't want to change directly in the default theme.

Denisa
  • 508
  • 1
  • 10
  • 26

3 Answers3

2

I don't know how I missed that on magento commerce

It is actually simpler than I thought, just using the right code in config.xml of your module:

<admin>
    <design>
        <package>
            <name>default</name>
        </package>
        <theme>
            <default>your_custom_theme_name</default>
        </theme>
    </design>
</admin>
sv3n
  • 11,657
  • 7
  • 40
  • 73
Denisa
  • 508
  • 1
  • 10
  • 26
1

Magento - Override adminhtml template/layout file

Add below code to config.xml file of extension (you created)

<stores>
<admin>
    <design>
        <theme>
            <default>default</default>
            <template>rwd</template>
        </theme>
    </design>
</admin>

Now create rwd folder under adminhtml/default folder package. app/design/adminhtml/default/rwd and create template and layout file as you want to override.

like we want to override order comment history.phtml file.

\app\design\adminhtml\default\default\template\sales\order\view\history.phtml 

\app\design\adminhtml\default\rwd\template\sales\order\view\history.phtml

OR you can also override layout file like.

   \app\design\adminhtml\default\default\layout\sales.xml 
   \app\design\adminhtml\default\rwd\layout\sales.xml
Savoo
  • 487
  • 5
  • 5
1

After you add the jQuery you should add another js file containing

jQuery.noConflict();

This will prevent jQuery from using $.

As both prorotype.js and jQuery are using the $, these two will never work together. One should drop the $.

Razvan
  • 76
  • 2
  • I am not sure you understood my question. I already have jQuery.noConflict(); and I don't have any issue until I merge js files. – Denisa Sep 23 '14 at 15:09