1

Using below code i'm getting cms page contents by page_id

$content = Mage::getModel('cms/page')->load(6)->getContent();       

print_r($content);

it's fetching value from database, so i'm getting invalid special characters like /r/n added and all </ is replaced with <\/

Is there any magento way to remove this invalid characters ?

  • hello feel free to accept amit's answer, if it helped you – Rajeev K Tomy Feb 14 '15 at 4:53
1

Vinoth, $content is a cms content for getting proper result you need to emulate this content using Cms Emulator,which give extract result of this container.

            $helper = Mage::helper('cms');
            $processor = $helper->getBlockTemplateProcessor();
            $html = $processor->filter($content);

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.