different homepage exhibit for mobile and desktop

Carnbot / 2018-10-10 21:43:57   

Hi :)

Is there a simple way to have a different homepage exhibit active for mobile browsers and another one active for desktop?

That would be great if so....

Vaska A / 2018-10-10 21:51:15   

There isn't a simple way. Or, what is simple?

The easiest way would be to edit /ndxzsite/plugin/format.mobile.php to redirect when you are showing the home page. Easy, if you know how, otherwise...yeah...knowing some code is required.

This is assuming you are using the mobile plugin - if your site was responsive (not using that plugin) then it's even more complicated.

Carnbot / 2018-10-10 22:18:48   

Great thanks, that's pointed me in the right direction. Yeah I'm using the mobile plugin.

Carnbot / 2018-10-11 08:17:47   

One way I found worked without using the mobile.php was to put a javascript redirect in the home page text area:

  1. <script type="text/javascript">
  2. <!--
  3. if (screen.width <= 699) {
  4. document.location = "new-home-exhibit-url";
  5. }
  6. //-->
  7. </script>
Vaska A / 2018-10-11 09:16:25   

If it works. It's not the appropriate use of javascript in the body (because the page is loading) but it will work. I don't know if there are implications for Google indexing however.

Carnbot / 2018-10-11 09:56:55   

Ok thanks for the info :) If I come across any issues will have a look into the mobile.php but that looked a bit trickier for me to figure out.

This thread has been closed, thank you.