We have inherited a development stage Magento site, where a lot of the blocks on the frontend are horribly misspelled. We are having to go through each block and edit them. One thing we noticed is that these rows generated by:
app/code/core/Mage/Adminhtml/Block/Cms/Block/Grid.php
are not clickable by href, but rather by js ajax. Is there any way to create an href link so that they can be opened in the browser in tabs? As editing each of these one at a time and not having the option to have more than one block editor at a time is not very time efficient. How would I go about creating a column in this grid programatically to create an "Edit" link that uses an href for $baseUrl
in the _prepareColumns()
method? I can just copy this file to the local code pool, I do not intend to modify core code, any help is greatly appreciated. If there is a factory method I'm unaware of, google search has not been fruitful in this regard.
Best Answer
To add an 'edit' link to the CMS Static Blocks grid, all you'd have to do is extend that block with your own module and rewrite
_prepareColumns
. But, I've already done all of this for you while testing :)See the code below:
app/code/local/YourCompany/YourModule/Block/Cms/Block/Grid.php
app/code/local/YourCompany/YourModule/etc/config.xml:
app/etc/modules/YourCompany_YourModule.xml
Adds a 'View' link, as advertised: