Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Template broken after 1.3 upgrade
 
Raptor Commerce (toby)
Sr. Member
 
Total Posts:  180
Joined:  2009-01-31
 

I was previously using the 1.2x version of Magento and created a new theme based on the ‘modern’ theme. I modified the product view template to allow an administrator to embed static blocks within a product short description. When entering product details on the admin screens an admin could include something like {{block type="cms/block" block_id="your_block_identifier" template="cms/content.phtml"}}

I achieved this by adding this line of code to the app/design/frontend/default/custom/template/catalog/product/view.phtml template:

<!-- Toby Change to allow embedding images or blocks in description using {{skin ... or {{block ... --> 
<
div class="short-description"><?php echo nl2br($this->processorFilter($this->getProduct()->getShortDescription())) ?></div
<!-- 
end Toby change -->

You can see the code in action at http://www.charleshobson.co.uk/green-coast-casual-jacket.html The ‘made in italy’ text and image is a static block that I reference in the product description

This worked nicely but the upgrade to 1.3x has broken things. I now see the following error when viewing a product:

Invalid method Mage_Catalog_Block_Product_View::processorFilter(Array
(
    
[0] => Test description 
)
)
Trace:
#0 [internal function]: Varien_Object->__call('processorFilter', Array)
#1 /Applications/MAMP/htdocs/magento-live/app/design/frontend/default/custom2/template/catalog/product/view.phtml(96): Mage_Catalog_Block_Product_View->processorFilter('Mediumweight co...')
#2 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Block/Template.php(144): include('/Applications/M...')
#3 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Block/Template.php(176): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#4 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Block/Template.php(193): Mage_Core_Block_Template->renderView()
#5 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Block/Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#6 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#7 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Block/Abstract.php(643): Mage_Core_Block_Text_List->_toHtml()
#8 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Block/Abstract.php(503): Mage_Core_Block_Abstract->toHtml()
#9 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Block/Abstract.php(454): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#10 /Applications/MAMP/htdocs/magento-live/app/design/frontend/default/custom2/template/page/2columns-left.phtml(66): Mage_Core_Block_Abstract->getChildHtml('content')
#11 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Block/Template.php(144): include('/Applications/M...')
#12 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Block/Template.php(176): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#13 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Block/Template.php(193): Mage_Core_Block_Template->renderView()
#14 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Block/Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#15 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Model/Layout.php(526): Mage_Core_Block_Abstract->toHtml()
#16 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Controller/Varien/Action.php(339): Mage_Core_Model_Layout->getOutput()
#17 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Catalog/controllers/ProductController.php(142): Mage_Core_Controller_Varien_Action->renderLayout()
#18 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Controller/Varien/Action.php(367): Mage_Catalog_ProductController->viewAction()
#19 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(247): Mage_Core_Controller_Varien_Action->dispatch('view')
#20 /Applications/MAMP/htdocs/magento-live/app/code/core/Mage/Core/Controller/Varien/Front.php(158): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#21 /Applications/MAMP/htdocs/magento-live/app/Mage.php(457): Mage_Core_Controller_Varien_Front->dispatch()
#22 /Applications/MAMP/htdocs/magento-live/index.php(52): Mage::run()
#23 {main}

Can anyone shed any light on what has changed between 1.2x and 1.3x?

Thanks in advance

Toby

 
Magento Community Magento Community
Magento Community
Magento Community
 
ttwhy
Member
 
Avatar
Total Posts:  70
Joined:  2008-01-27
 

themes like you need to remove the processFilter function.

If you still need to shortDiscription you can try to use the “getData()” function, which returns a more or less full array of the product properties (and the shortdescription is included there)

 
Magento Community Magento Community
Magento Community
Magento Community
 
Raptor Commerce (toby)
Sr. Member
 
Total Posts:  180
Joined:  2009-01-31
 
ttwhy - 25 April 2009 12:21 PM

themes like you need to remove the processFilter function.

If you still need to shortDiscription you can try to use the “getData()” function, which returns a more or less full array of the product properties (and the shortdescription is included there)

Yeah I can remove the call to that function but what I’m trying to understand is how I can achieve the same thing in 1.3x i.e being able to embed static blocks etc in my product descriptions

Thanks anyway

Toby

 
Magento Community Magento Community
Magento Community
Magento Community
 
eliezerisrael
Jr. Member
 
Total Posts:  28
Joined:  2009-06-18
 

Did you every figure this one out?  I’m looking to embed blocks in the product descriptions…

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top