Forum Join our community

Make template for Portfolio Plus Article Module

  1. Normal
  2. mostafa
  3. -
  4. Styles
  5. -
  6. Saturday, 11 August 2018
  7. -
  8.  Subscribe via email
0
Votes
Undo
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.
Comment
There are no comments made yet.
Sonny Accepted Answer Pending Moderation
  1. Wednesday, 15 August 2018
  2. -
  3. # 1
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 ;)
Comment
There are no comments made yet.
mostafa Accepted Answer Pending Moderation
  1. Wednesday, 15 August 2018
  2. -
  3. # 2
0
Votes
Undo
You mean after doing that,

$item->event->onContentDisplayMediaType


will be OK? because I did that but method still returns nothing!
Comment
There are no comments made yet.
Sonny Accepted Answer Pending Moderation
  1. Thursday, 16 August 2018
  2. -
  3. # 3
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
Attachments (1)
I am Sonny! A farmer at TZ Portfolio+ Team :D
Please vote for TZ Portfolio on JED ;)
Comment
There are no comments made yet.
mostafa Accepted Answer Pending Moderation
  1. Thursday, 16 August 2018
  2. -
  3. # 4
0
Votes
Undo
Thank you but I think my method is less complicated ;)
Comment
There are no comments made yet.
Sonny Accepted Answer Pending Moderation
  1. Thursday, 16 August 2018
  2. -
  3. # 5
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 ;)
Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Share Location

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

Latitude:
Longitude: