Topic: Mobile detect plugin request;

Hi,

can anybody make plugin for this: http://mobiledetect.net/  please? I am not able to do it manul into header.chunk.php

Re: Mobile detect plugin request;

Monstra have this method

if (Agent::isMobile()) {
    // Do something...
}
..::: Moncho Varela ::::..   ..::: @Nakome ::::..   ..::: Github ::::..

Re: Mobile detect plugin request;

@nakome, @raipergm34

PHP rules! wink

Also you can add this using javascript

<script type="text/javascript">
  <!--
  if (screen.width <= 800) {
    window.location = "http://m.domain.com";
  }
  //-->
</script>

As you see in code if the resolution is not bigger then 800px user will be redirected to m.domain.com

wink

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

Re: Mobile detect plugin request;

And depending on what you are tying to achieve..
If its the frontend you might want to look at using Bootstrap's responsive grid system so that it automatically reflows/ hides & shows depending on screen size.

http://getbootstrap.com/css/#grid
http://getbootstrap.com/css/#responsive-utilities

Re: Mobile detect plugin request;

Php ismobile function is for include or o require_once files in same template or load other scripts without redirecting page.

..::: Moncho Varela ::::..   ..::: @Nakome ::::..   ..::: Github ::::..

Re: Mobile detect plugin request;

Yes but he wants to redirect user i guess... Well he have many solutions now wink

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

Re: Mobile detect plugin request;

Thanks guysm i wanted to generate another link on my webpage, if is mobile then a href = .... else a href = .... so i am going to try it, but i think it should work for me smile

Re: Mobile detect plugin request;

@raipergm34

As been a wille now did it worked for you? big_smile

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

Re: Mobile detect plugin request;

Yes it did smile