Giorgi625 VIP
Total posts: 655
18 Apr 2019 10:40

https://i.postimg.cc/L6wYxvVk/list-template.png

AS seen from screenshot if you have multiple list templates it sets as default by alphabet so in my case default template was kkrelations (which is greed of article images and titles),but after I set in last field list-drama (which shows image on left and text info on right with title and some other fields) it set as default that template.

My problem is that I want to have on desktops and tablets list-drama as default, but on mobiles kkrelations.

Can it be done?

Last Modified: 02 May 2019


pepperstreet VIP
Total posts: 3,837
18 Apr 2019 23:41

Giorgi625 My problem is that I want to have on desktops and tablets list-drama as default, but on mobiles kkrelations.

Based on what criteria? Is it total different template design and structure...

Isn't it a task for CSS and media-queries?

If you want to switch to a different physical file, you might need something like "mobile-detect" library. I remember there was a similar but older library in Joomla core. No idea, if it is still present or maintained.


Sergey
Total posts: 13,748
19 Apr 2019 04:03

possible only with custom coding and that will be a hack. You have to detect request platform and change theme based on this.

Why cannot you create one template and aling image diferently based on width of the page. That was whole purpose of responsive technology to have single template for all devices.


Giorgi625 VIP
Total posts: 655
19 Apr 2019 08:14

Yes my both templates are responsive but template which I want on desktop contains more data, while template for mobile contains less data.

I do not want to load all data on mobile to speed up page load, but ok.If it can't be done easily I will leave as it is now.


Sergey
Total posts: 13,748
26 Apr 2019 03:49

Giorgi625 Yes my both templates are responsive but template which I want on desktop contains more data, while template for mobile contains less data.

I do not want to load all data on mobile to speed up page load, but ok.If it can't be done easily I will leave as it is now.

What stops you to check media and use PHP in a template to output some data or not?


pepperstreet VIP
Total posts: 3,837
02 May 2019 03:22

What about "Conditional Content" by RegularLabs.nl. Obviously more than just devices checks, but it seems to be easy to use. Apparently utilizing "mobile detect" PHP lib.

There are also other solutions in Joomla CMS and framework. I have read about jBrowser and the WebClient, which seem to live here:

YourJoomla/libraries/joomla/application/web/client.php


For your interest, some Joomla Github issues. It's not clear to me, what the future plans are. Or if there is a real chance to incorporate the solution from mobile-detect.net

https://github.com/joomla/joomla-cms/pull/18732
https://github.com/joomla/joomla-cms/issues/16528

Powered by Cobalt