Disable field on mobiles

More
5 years 6 months ago #74854 by ggppdk
Replied by ggppdk on topic Disable field on mobiles
Hello

about modules,
the setting exists already in our modules

about plugins
it was almost added 2 years ago ...

I know it is possible as mentioned above to do it at template code (do no add field at a position and and instead use IF and getFieldDisplay())
but totally agree it is good to have in field code itself
and once added , most users that will see it , will make use of it


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago #74856 by lipatovroman

ggppdk wrote: Hello

about modules,
the setting exists already in our modules

about plugins
it was almost added 2 years ago ...

I know it is possible as mentioned above to do it at template code (do no add field at a position and and instead use IF and getFieldDisplay())
but totally agree it is good to have in field code itself
and once added , most users that will see it , will make use of it


Yes, but we need more flexible abilities.
We need use your library for detecting devices not only for fields, but also for our own elements in layout.
Also we need to have ability to disable filtering and sorting on mobiles and allow it on desktops.
It's a key feature. 
My last site have 70% traffic from mobiles. I have to make pages lightweight and Google should see, that pages loading very fast.
Otherwise - no success. Other more fast CMS and optimized pages will displays in Google Top.

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago - 5 years 6 months ago #74858 by ggppdk
Replied by ggppdk on topic Disable field on mobiles
Hello

We need use your library for detecting devices not only for fields, but also for our own elements in layout.

you can use this:
(the following code is e.g used inside image-gallery field)
Code:
$mobileDetector = flexicontent_html::getMobileDetector(); $isMobile = $mobileDetector->isMobile();  // Is Phone or Tablet $isTablet = $mobileDetector->isTablet();  // Is Tablet


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 5 years 6 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago - 5 years 6 months ago #74860 by lipatovroman

ggppdk wrote: Hello

We need use your library for detecting devices not only for fields, but also for our own elements in layout.

you can use this:
(the following code is e.g used inside image-gallery field)
Code:
$mobileDetector = flexicontent_html::getMobileDetector(); $isMobile = $mobileDetector->isMobile();  // Is Phone or Tablet $isTablet = $mobileDetector->isTablet();  // Is Tablet


And then?
Code:
if ($isMobile || $isTablet) { echo "Yes"; }
Is it correct?
Last edit: 5 years 6 months ago by lipatovroman.

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago - 5 years 6 months ago #74864 by ggppdk
Replied by ggppdk on topic Disable field on mobiles
Hello

$isMobile = $mobileDetector->isMobile();

includes the Tablet case already !
Code:
if ($isMobile) {   echo "Current client is phone or tablet";   echo $isTablet     ? "You are a Tablet"     : "You are a phone"; }


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 5 years 6 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago - 5 years 6 months ago #74887 by lipatovroman

ggppdk wrote: Hello

$isMobile = $mobileDetector->isMobile();

includes the Tablet case already !

Code:
if ($isMobile) {   echo "Current client is phone or tablet";   echo $isTablet     ? "You are a Tablet"     : "You are a phone"; }


Hello!
Does  not work.
Displays error: Call to a member function isMobile() on null
I added this code in item.php
Code:
$isMobile = $mobileDetector->isMobile(); if ($isMobile) {   echo "Current client is phone or tablet";   echo $isTablet     ? "You are a Tablet"     : "You are a phone"; }
Last edit: 5 years 6 months ago by lipatovroman.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.720 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline