| Re: Publisher Random Item Image |
| by Zap_English on 2017/5/7 8:29:04 That fixed it YOU DA MAN, BLEEKK!
|
| Re: Publisher Random Item Image |
| by Bleekk on 2017/5/7 8:19:23 Add this line to the Block function le="color: #000000"><?php $block['title'] = $itemsObj->title();
|
| Re: Publisher Random Item Image |
| by Zap_English on 2017/5/7 7:59:21 OK, that worked, HOORAY! But it caused another problem. Not sure why The first line of the tpl file I had inserted <center><h4><{$block.title}></h4></center> so that it would display the title of the item. the next line is your block image, modified as <img src="<{$block.item_image}>" alt="" width="100" height="100" align="left" style="padding:5px;"/> So now it displays the image correctly, and the beginning text of the article, but it stopped showing the Title. Now sure why that's happening |
| Re: Publisher Random Item Image |
| by Bleekk on 2017/5/6 18:31:28 items_random_item.php change the publisher_items_random_item_show function le="color: #000000"><?php function publisher_items_random_item_show($options) { $block = array(); $publisher = PublisherPublisher::getInstance(); // creating the ITEM object $itemsObj = $publisher->getHandler('item')->getRandomItem('', array(PublisherConstants::PUBLISHER_STATUS_PUBLISHED)); if (!is_object($itemsObj)) { return $block; } $block['content'] = $itemsObj->getBlockSummary(300, true); //show complete summary but truncate to 300 if only body available $block['id'] = $itemsObj->itemid(); $block['url'] = $itemsObj->getItemUrl(); $image = $itemsObj->getMainImage(); $block['image'] = $image['image_path']; if(!$block['image']){ $block['image'] = "path_to_your_default_image"; } $block['lang_fullitem'] = _MB_PUBLISHER_FULLITEM; return $block; } in template add this le="color: #000000"><?php <img src="<{$block.image}>"/>
|
| Re: Publisher Random Item Image |
| by Zap_English on 2017/5/6 17:52:56 Quote:
|