Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

Responsive Background Slideshows

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Hi JB,

Background images that are suitable for desktops, may not be so good for tablets or mobile devices. I suggest that you be given three alternative folders as shown in the attachment. Then with a minor change to /templates/venture/tpls/blocks/banner.php, you could select images from the appropriate folder based on the type of browser.

Forgive me if there are plans to make this change or another template might have been more appropriate - I'm new to this!

Pete
Attachments:
  • artful's Avatar
  • artful
  • LIfetime Developer - Big Bamboo
  • 37 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
Hi Pete,

I'll pass on your suggestion to the developers - I'm not sure how complex this would be to implement

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Thanks, Paulus. I've attached a cut down version (identifying mobile devices only, not tablets) of banner.php (see attachment) - it's very simple.

Pete

File Attachment:

File Name: banner.zip
File Size: 2 KB
  • artful's Avatar
  • artful
  • LIfetime Developer - Big Bamboo
  • 37 posts
  • 1 Thanks
  • Karma: 1
Last Edit: 6 years 3 months ago by artful. Reason: File didn't send
The administrator has disabled public write access.
The following user(s) said Thank You: manh
Hi Pete,

Thanks - could you attach in a zip file
The forum will block php file attachments

much appreciated

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Hi ,

I think it is a good idea, to have different slides for different sizes.

I often wish to have the possibility to change the image for the mobile devices.

best sebbie
  • Sebbie's Avatar
  • Sebbie
  • 12 Month Developer
  • 131 posts
  • 6 Thanks
  • Karma: 4
The administrator has disabled public write access.
Hi Sebbie,

Thanks for the input I've not had a chance to talk to Anthony about this yet

Will update as soon as I can

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Hey Pete - thanks for adding this.

I'd like to add more granular control over the responsive stuff in the framework and this would be the kind of thing I'd like to offer. In most themes you would just show and hide different module rows based on screen width but for Venture this is probably the best way to do it.

There are already some mobile checks in the framework:

So if you are in the tmpl/default.php file you would add something like this:

if($zen->is_mobile()) {
// add stuff here
}

or in a block:

if($this->is_mobile()) {
// add stuff here
}


Mobile covers both tablets and phones

Or to target phone only
$this->is_phone
$zen->is_phone

or tablets
$this->is_tablet
$zen->is_tablet

You need to have the mobile detect library enabled int he template settings but this might be an easier way to build that kind of functionality into your theme.

Thanks!
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
The following user(s) said Thank You: artful
Thanks, Anthony.

But that wouldn't allow you to change the background slidehow image(s), would it? Except maybe by hardcoding in an alternative file path(?).

Thanks also for the info on how to detect phones (as distinct from tablets).

Pete
  • artful's Avatar
  • artful
  • LIfetime Developer - Big Bamboo
  • 37 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
Hi Pete,

I guess why I pointed this out was regarding your browser instance code.

I would do something similar to what you had done but just use the built in mobile detect.

eg

if(tablet) // load these files
if(phone) // Load these files etc.

Or even just have sub folders for each screen you wanted to target: eg

images/greece/desktop
images/greece/tablet
images/greece/phone

And then load whatever was relevant. That way you can use it across different menus with different images.

What you have is fine though :)
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
The following user(s) said Thank You: artful
Thank you, Anthony. That gives me lots of info to proceed with.

I'm very impressed with the responsiveness on the forum. Well done!

I think I can close this thread now.

Pete
  • artful's Avatar
  • artful
  • LIfetime Developer - Big Bamboo
  • 37 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
Thanks Pete :)

Good luck with the site

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers