10

I use magento EE 1.13.1.0 with custom theme which is set in System->Configuration->Design->Default.

The issue appears when we use Magento CMS Preview. It is displayed without custom theme styles, because by default magento preview use base/default theme.

If I edit Design tab of CMS Page and set Custom Theme attribute to some custom theme everything will work. But not by default.

Had someone this issue before? Maybe I missed some configuration?

Anyway to fix this issue I created observer and attached it to cms_page_render event to check if Custom Theme attribute of CMS page is set. If not, then use real default theme:

public function setDefaultThemeForCmsPreview(Varien_Event_Observer $oObserver)
{
    $oRequest = $oObserver->getControllerAction()->getRequest();
    if (
        $oRequest->getControllerName() == 'cms_page_revision' && 
        $oRequest->getActionName() == 'drop'
    ) {
        $oCmsPage = $oObserver->getPage();
        if ($oCmsPage->getCustomTheme()) {
            list($sPackage, $sTheme) = explode('/', $oCmsPage->getCustomTheme());
        } else {
            $sPackage = Mage::getStoreConfig('design/package/name');
            $sTheme   = Mage::getStoreConfig('design/theme/default');
        }
        Mage::getSingleton('core/design_package')
            ->setPackageName($sPackage)
            ->setTheme($sTheme);
    }
}
3
  • 2
    Using EE, you have paid support with Varien. Ask them about this, could be a bug that they will fix for you.
    – ProxiBlue
    Feb 11, 2014 at 13:59
  • 1
    For the record I put the above Observer into place and it appears to be working well until a fix can be supplied by Magento Feb 21, 2014 at 2:08
  • You may want to post your solution as an answer and accept it. Feb 26, 2014 at 15:01

2 Answers 2

2

I have come across this issue in Magento Enterprise 1.12.x - it does seem to be a Magento bug that has not been looked at. I believe my fix was to edit the AdminHTML however I believe your solution is more elegant.

0

The same problem i got, for that i Just copied "styles.css" and paste it to the "\skin\frontend\base\default\css" folder, then problem solved.

The css file not exist there, so the problem occured. May be this is the problem.

2
  • Thank you for the answer. But moving styles from your current theme to `base\default` is not good fix of the problem. First of all, this is code duplication(you will need to support two files if you need to make changes to styles). The second negative point is that if you will change the theme, your problem will appear again. Feb 20, 2014 at 8:25
  • I think, The problem caused because of style-sheet missing so i just copied CE default theme css(styles.css) to here. its work fine. Even i have change the theme its working fine. I not suggest this is the solution, this is a bug in EE.
    – Helphin
    Feb 20, 2014 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.