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 9176437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:06:33+00:00 2026-06-17T17:06:33+00:00

I have read several posts on stack overflow Overriding a Magento Adminhtml template file

  • 0

I have read several posts on stack overflow

  • Overriding a Magento Adminhtml template file
  • Magento – overriding Adminhtml block

and a couple threads on the magento forum

  • http://www.magentocommerce.com/boards/viewthread/21978/

However, None of these posts attempt to do what I am trying to do

I would like to override the

app/design/adminhtml/default/default/template/widget/grid.phtml 

file, as this file contains a portion of html that allows anyone to export from the sales->order view.

Note: We have disabled all of the export options for this user role in the permissions->role view

The code that displays the “Export to: ” -> “CSV/Excel XML” feature is included in the path I have listed above. I would like to remove that chunk of html and override the file included with Magento.

  • 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-17T17:06:33+00:00Added an answer on June 17, 2026 at 5:06 pm

    Adminhtml uses the same theming fallback as the frontend, therefore you need only declare a custom template theme for your installation in module config XML:

    <stores>
        <admin>
            <design>
                <theme>
                    <template>custom</template>
                </theme>
            </design>
        </admin>
    </stores>
    

    Then you can create app/design/adminhtml/default/custom/template/widget/grid.phtml with any customizations you like, and this file will be used in preference to the one from the default/default adminhtml theme. Your solution then would be to add an ACL check in the logic which renders the export control:

    <?php if($this->getExportTypes() && {ACL LOGIC}}): ?>
        <td class="export a-right">
            <img src="<?php echo $this->getSkinUrl('images/icon_export.gif') ?>" alt="" class="v-middle"/>&nbsp; <?php echo $this->__('Export to:') ?>
            <select name="<?php echo $this->getId() ?>_export" id="<?php echo $this->getId() ?>_export" style="width:8em;">
            <?php foreach ($this->getExportTypes() as $_type): ?>
                <option value="<?php echo $_type->getUrl() ?>"><?php echo $_type->getLabel() ?></option>
            <?php endforeach; ?>
            </select>
            <?php echo $this->getExportButtonHtml() ?>
        </td>
    <?php endif; ?>
    

    While this logic might be more appropriately implemented in the block class, the class rewrite system does not accommodate rewriting of parent classes, leaving you to rewrite every subclass. In this instance, obeying DRY outweighs embedding too much logic in templates. Moreover, the change is obvious and easily maintained.

    Ideally the core team would have implemented this check in the Mage_Adminhtml_Block_Widget_Grid class or at least provided a public setter for the _exportTypes property, which would have made this logic a bit cleaner to implement.

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

Sidebar

Related Questions

I have read tutorials and several stack overflow posts that suggest I should use
I've read several of the posts on stack overflow already about this topic, but
I have read several posts about the configuration manager in VS2010 (or before) but
i have to write a program in C to read a file containing several
I have read several related posts but while some of them are for emulators
I have read several articles and several stackoverflow.com posts about expression tree. It is
I have read several related posts about installing numpy for python version 2.7 on
I have read several posts already. And almost everyone suggest using QuartzCore/QuartzCore.h with layer.cornerRadius
I have read several posts on SO about writing and compiling dynamic C# code.
I have read several posts here about detach and attach. But it should be

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.