By Kirill Pilipenko on Saturday, 10 March 2018
Posted in Technical Issues
Replies 7
Likes 0
Views 466
Votes 0
Hello guys. So you have this module mod_easysocial_pages which display pages from EasySocial.
It works great. But there is one issue.

It downloads pages backgrounds in full size. It increases webpage download speed A LOT
I have 4 groups in this module only - but it's already almost 2 extra mb of data. Look at the screenshot


Here is line from this module code :

<div style="background-image : url(/<?php echo $page->getCover()?>);
background-position : <?php echo $page->getCoverPosition();?>" class="mod-card__cover">



I did check, for every page background you have different versions:

  • _thumbnail
  • _stock
  • _large


In our case by request $page->getCover()? we are getting " _large"
Tell me please, how can I request for "_thumbnail" version of the picture?

P\s I tried to find it in Mysql but no results. That's why I'm asking you

Do you have some documentation with all this $page->(something)?
Because more I working with EasySocial more small bugs I'm finding. I don't want to disturb you every time =)
Hey there,

I am really sorry for the delay of this reply as it is a weekend for us here.

I've checked the code, it seems like that was difficult to customise to show thumbnail image from the module only, because currently all the group/event/page cover will call this method, you can check my attached screenshot below.

JoomlaFolder/administrator/components/com_easysocial/tables/cover.php

Yes, you can just modify that image size from large to thumbnail, but it will affect on the group/event/page cover image if the module also display on the group/event/page as well.
·
Saturday, 10 March 2018 10:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Arlex. I still don't understand why it was difficult to customize to show thumbnail image.
But I fixed it.

JoomlaFolder/modules/mod_easysocial_pages/tmpl/card.php

Change 18 line of code from :


<div style="background-image : url(<?php echo $page->getCover()?> ) ;



to:



<?php $backgrsk =("_large.jpg");
$backgrsk2 = ("_thumbnail.jpg");
$newbacsk = str_replace($backgrsk, $backgrsk2, $page->getCover());
?>
<div style="background-image : url(<?php echo $newbacsk?> ) ;



P\s hope you can include it in new versions of EasySocial so people will not struggle with a large page weight and slow download speed.
·
Monday, 12 March 2018 23:16
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Kirill,

This is a pretty hack-ish method which we wouldn't recommend but we'll need to update the getCover method which Arlex pointed out above to make life much easier in the future, especially with templating cases like this.

I will log this issue in our issue tracker.
·
Monday, 12 March 2018 23:20
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post