Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Banner Module - Different image dimensions for mobile

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 11-14-2016, 12:55 PM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Banner Module - Different image dimensions for mobile

The banner module as far as I can see serves the same size images whatever the screen size.

This means a lot of waste bandwidth on small devices.

Foundation has a tool that requests content based on screen size: http://foundation.zurb.com/sites/docs/interchange.html

This is different from just using classes to show or hide content as the content isn't requested at all with Interchange.

Is there any plans to introduce something like this in the module?
__________________
Core version: 5.5.xx
Reply With Quote
  #2  
Old 11-14-2016, 11:41 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Banner Module - Different image dimensions for mobile

Do you mean this banner module?
https://market.x-cart.com/addons/banner-system.html
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 11-15-2016, 12:52 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Re: Banner Module - Different image dimensions for mobile

Yes.
__________________
Core version: 5.5.xx
Reply With Quote
  #4  
Old 01-19-2017, 03:23 AM
  Dmitry's Avatar 
Dmitry Dmitry is offline
 

Member
  
Join Date: Jun 2010
Posts: 18
 

Default Re: Banner Module - Different image dimensions for mobile

If there is no other idea then why not try to dev a simple module for loading a custom css file on home page only and load @media css for this container items...

Please let me know your feedback
__________________
xcart power and php/html/js coder is best friend
Reply With Quote
  #5  
Old 01-28-2017, 01:47 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Banner Module - Different image dimensions for mobile

Thank you for your feedback!

I've notified the module developer and she has this improvement in her to-do list for the module.
However, it is in her future plans, not something that will be implemented in the near future.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #6  
Old 02-27-2017, 11:49 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Re: Banner Module - Different image dimensions for mobile

I'm wondering if the mobile detection scripts could be used somehow.

maybe class AMobile_Detect in xcart/lib/

or something with

\XLite\Core\MobileDetect::getInstance()->isMobile()

to do something like

{% if this.getBannerBoxes() && !isMobilePhone() %}
<div class="bannerBox">
......
{% endif %}

?
__________________
Core version: 5.5.xx
Reply With Quote
  #7  
Old 05-05-2017, 02:27 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Re: Banner Module - Different image dimensions for mobile

I just discovered after some investigation that the IsVisible method for this module always returns true. Possible due to the negation of the isMobileDevice not giving the expected result.

Code:
/** * Check if widget is visible * * @return boolean */ protected function isVisible() { if (!\XLite\Core\Database::getRepo("XLite\Model\Module")->findOneBy(array("name"=>"Mobile", "author"=>"XC", "enabled"=> true)) || !\XLite\Core\Request::isMobileDevice()) { $result = true; } else { $result = false; } return parent::isVisible() && $result; }

Dropping the negation and swapping the true and false like this works..
Code:
protected function isVisible() { if (\XLite\Core\Database::getRepo("XLite\Model\Module")->findOneBy(array("name"=>"Mobile", "author"=>"XC", "enabled"=> true)) || \XLite\Core\Request::isMobileDevice()) { $result = false; } else { $result = true; } return parent::isVisible() && $result; }

So now it doesn't show the banner on mobile which is what I wanted.
__________________
Core version: 5.5.xx
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:19 PM.

   

 
X-Cart forums © 2001-2020