Off Canvas sidebar is empty
  Saturday, 11 August 2018
  5 Replies
  3.8K Visits
0
Votes
Undo
  Subscribe
Hello

I want to make a template for mod_tz_portfolio_plus_articles and for image section :


<img src="/<?php echo substr($item->media->image->url,0,-4)."_".$params->get('mt_image_size') ?>" alt="<?php echo $item->media->image->caption ?>">


It's working good but it's a little ugly script! also somewhere found:

$item->event->onContentDisplayMediaType


And output is empty! is there a better way to do that?
with best.
5 years ago
·
#935
0
Votes
Undo
I tested with $item->event->onContentDisplayMediaType and template works well. If you need further assistant, please contact us.

Best Regards,
Sonny

I am Sonny! A farmer at TZ Portfolio+ Team :D
Please vote for TZ Portfolio on JED ;)

5 years ago
·
#934
0
Votes
Undo
Thank you but I think my method is less complicated ;)
5 years ago
·
#932
0
Votes
Undo
Please check our example for override module in template Kavin II.

Screen Shot 2018-08-16 at 15.01.15.png

Best Regards,
Sonny

I am Sonny! A farmer at TZ Portfolio+ Team :D
Please vote for TZ Portfolio on JED ;)

5 years ago
·
#927
0
Votes
Undo
You mean after doing that,

$item->event->onContentDisplayMediaType


will be OK? because I did that but method still returns nothing!
5 years ago
·
#926
0
Votes
Undo
Sorry for late reply! You can override image addon in mod_tz_portfolio_plus_articles by create plg_mediatype_image in your template.
For example: root/templates/{your-template}/html/mod_tz_portfolio_plus_articles/plg_mediatype_image/default.php

example code of default.php:

defined('_JEXEC') or die;

if($item && $image && isset($image -> url) && !empty($image -> url)):
$doc = JFactory::getDocument();
$doc -> addStyleSheet(TZ_Portfolio_PlusUri::base().'/addons/mediatype/image/css/style.css');
if($params -> get('mt_show_image',1)):
?>
<a data-fancybox="gallery" href="/<?php echo $image -> url;?>"><div class="tz_portfolio_plus_image" style="background-image: url('/<?php echo $image -> url;?>');"></div></a>
<?php endif;?>
<?php endif;?>


Hope it can help!

Best Regards,
Sonny

I am Sonny! A farmer at TZ Portfolio+ Team :D
Please vote for TZ Portfolio on JED ;)

  • Page :
  • 1
There are no replies made for this post yet.
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below.
Supported: gif,jpg,png,zip,rar
· Insert · Remove
  Upload Files (Maximum 2MB)

Sharing your current location while posting a new question allow viewers to identify the location you are located.

Login