I have the following code in template/page/html/head.phtml, and for social network sharing I need access to the blogpost content so I can extract the images from the blogposts.

$post = Mage::getSingleton('blog/cat')->load(Mage::app()->getRequest()->getParam('post_id', Mage::app()->getRequest()->getParam('id', false))))
$page = $post->getContent();

but this doens't give me the content of the current blogpost being viewed.

1 Answer 1


Well, under the motto of "hack the world" I pieced together this code myself:

if($content = Mage::getSingleton('blog/post')->getData('post_content'))
   $blog_content = Mage::helper('cms')->getPageTemplateProcessor()->filter($content);
   //do what needs to be done.

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.