Hi
in the market plugin,
http://community.elgg.org/plugins/407901/1.8f/market-plugin
When I upload an image I would like to have it show up in the River with a thumbnail of the picture.
I use add this code to the mod/market/views/default/river/object/market/create.php
'attachments' => elgg_view_entity_icon($object,'small'),
but it does not work.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- slyhne@slyhne

slyhne - 0 likes
You must log in to post replies.THis is how it's done in mod/market/views/default/river/object/market/create.php :
<?php
/**
* Market river view.
*/
$object = $vars['item']->getObjectEntity();
$excerpt = strip_tags($object->excerpt);
$excerpt = elgg_get_excerpt($excerpt);
$img = elgg_view('output/img', array(
'src' => "market/image/{$object->guid}/medium/{$object->time_updated}",
'class' => 'elgg-photo',
));
$image = elgg_view('output/url', array(
'href' => "market/view/{$object->guid}/" . elgg_get_friendly_title($object->title),
'text' => $img,
));
echo elgg_view('river/item', array(
'item' => $vars['item'],
'message' => $excerpt,
'attachments' => $image,
));