php - Get images out of product description in phtml file -


as title might let suggest have trouble image url's out of product descriptions in custom phtml file (located in template folder).

in cms pages/blocks can use

{{media url="wysywig/banner/image.jpg"}} 

which parts (headlines) of our product descriptions.

now when try display description out of phtml file with

<?php echo nl2br($productresult[$i]->getdescription()); ?> 

the description gets loaded image url's dont converted total url's example "/media/wysywig/banner".

i know have use mage::geturl("media") in php/phtml files though information doesn't in situation.

the idea have set string function search {{media url="wysywig/banner/image.jpg"}} , replace mage::geturl("media/wysywig/image.jpg") kinda feel isn't elegant solution.

or way? appreciated. , greetings mpfmon

it doesn't work because not planned product description have such media call:

{{media url="wysywig/banner/image.jpg"}} 

however there nothing wrong doing this, make work, have filter description widget function:

echo mage::getsingleton('widget/template_filter')->filter($description); 

Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -