Elxis CMS Forum

Support => General => Topic started by: armpouniotis on September 30, 2019, 19:36:21

Title: How to enable mobile version in new Elxis 5.0
Post by: armpouniotis on September 30, 2019, 19:36:21
Hi there !

I am trying to enable mobile version on elxis 5.0

I can't see any option inside settings.

There isn't any module about it as well ! (as far as I remember there used to be in previous versions...)

Any ideas how to enable it ?

Thank you in advance
Christos
Title: Re: How to enable mobile version in new Elxis 5.0
Post by: webgift on October 01, 2019, 09:06:34

Hello @armpouniotis!
This option deprecated in Elxis 5. Most of the templates are responsive to
portable devices so there is no the need to create a version for mobile that
it will be different than the responsive approach of your elxis website.
Title: Re: How to enable mobile version in new Elxis 5.0
Post by: armpouniotis on October 01, 2019, 13:18:46
you are wrong ! (sorry to say that...)

in previous elxis versions 4.x, I used to modify these files: mobile.php etc located in"templates > system, in order to adjust my template in mobile version, something which is very useful !

Since I can't do this anymore, my template doesn't look the way my clients want !

If i copy / paste the files from previous elxis version (4.x), to new version (5.0), will they work ?

Thank you in advance
Christos
Title: Re: How to enable mobile version in new Elxis 5.0
Post by: webgift on October 01, 2019, 14:21:17

:)
You can simply diplay: none the HTML elements in deskop and make them visible in
portable devices by making display: block;

It's been a long time ago since i see mobile version for a website.
Title: Re: How to enable mobile version in new Elxis 5.0
Post by: armpouniotis on October 01, 2019, 14:45:29
ok I will give it a try...

Christos
Title: Re: How to enable mobile version in new Elxis 5.0
Post by: datahell on October 01, 2019, 18:54:29
Mobile version is deprecated as of Elxis 5.0 and the old "ELXIS_MOBILE" constant is always 0. However if you want to have a mobile (tablet, web tv, or other) specific version of your template you can easily do it.

Inside your template's index.php file write:
$is_mobile = $elxis->obj('browser')->isMobile();

Then you can include different template's files based on the mobile status (with different layout, modules positions, etc) :

if ($is_mobile) {
    include(ELXIS_PATH.'/templates/mytemplate/mobileversion.php');
} else {
    include(ELXIS_PATH.'/templates/mytemplate/pcversion.php');
}

The recommended option
The recommended option is to use responsive templates.
Elxis also provides you out-of-the-box CSS classes to easily display different content based on the device status without changing the html.
These css classes are the following:

elx5_mobhide Hide on mobile devices (480px or less)
elx5_lmobhide Hide on mobile devices with large screen (650px or less)
elx5_tabhide Hide on tablet devices (767px or less)
elx5_smallscreenhide Hide on small size screens (980px or less)
elx5_midscreenhide Hide on medium size screens (1240px or less)
elx5_lmobshow Show on mobile devices with large screen (650px or less)

Sample usage:
<div class="myclass elx5_lmobhide">Hello PCs!</div>
<div class="myclass elx5_lmobshow">Hello Mobiles!</div>
Title: Re: How to enable mobile version in new Elxis 5.0
Post by: armpouniotis on October 01, 2019, 21:52:38
ok ! This is very useful information !

In that case, Elxis gives me more options on making templates....

I will do some more research on that and I will let you know !

Christos

Title: Re: How to enable mobile version in new Elxis 5.0
Post by: webgift on October 02, 2019, 11:02:41

It was a more complete answer indeed!