Welcome to TalkGraphics.com
Results 1 to 10 of 33

Hybrid View

  1. #1
    Join Date
    May 2002
    Location
    Canada
    Posts
    3,345

    Default Re: Temporarily hiding mobile variant

    You can paste this to your home page when ready.

    <script type="text/javascript">
    <!--
    if (screen.width <= 480) {
    document.location = "http://domainname.com/mobilename";
    }
    //-->
    </script>

    You can change the 480 px to 600 or 800 depending on your needs.

  2. #2
    Join Date
    May 2009
    Posts
    300

    Default Re: Temporarily hiding mobile variant

    Quote Originally Posted by behzad View Post
    You can paste this to your home page when ready.

    <script type="text/javascript">
    <!--
    if (screen.width <= 480) {
    document.location = "http://domainname.com/mobilename";
    }
    //-->
    </script>

    You can change the 480 px to 600 or 800 depending on your needs.
    Don't think my original reply to this went through.. Thanks for the suggestion. But surely when I'm ready to publish both variants (deleting the mobile version before each publish in the meantime), the Xara coding would automatically redirect mobile users to the correct version. Or am I missing something?

  3. #3
    Join Date
    May 2002
    Location
    Canada
    Posts
    3,345

    Default Re: Temporarily hiding mobile variant

    If you delete the mobile version then there is no reason why the main site should direct it to your custom mobile version, unless you put the above code into the index page of your main site. If anyone else thinks I am wrong, please let us know.

  4. #4
    Join Date
    May 2009
    Posts
    300

    Default Re: Temporarily hiding mobile variant

    Quote Originally Posted by behzad View Post
    If you delete the mobile version then there is no reason why the main site should direct it to your custom mobile version, unless you put the above code into the index page of your main site. If anyone else thinks I am wrong, please let us know.
    Perhaps my query wasn't clear. I need to hide the mobile version only while developing it. So I'm currently doing, as Gary recommended:
    Save your site. Then save your site with a new name, for example Desktop only. Delete the Mobile Variant and publish.

    When the mobile version is ready to publish I will publish the complete version (desktop and mobile). So if I understand correctly, there should never be a need for extra code.

  5. #5
    Join Date
    May 2002
    Location
    Canada
    Posts
    3,345

    Default Re: Temporarily hiding mobile variant

    I like to hear what the other wizards will say about this.

  6. #6
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,944

    Default Re: Temporarily hiding mobile variant

    No code, treat the design with Main and Variant as the Master.
    Clone it on every publishing revision but remove the Variant before publishing.

    When happy, publish the Master.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  7. #7
    Join Date
    Apr 2015
    Location
    Germany
    Posts
    927

    Default Re: Temporarily hiding mobile variant

    Off course it can be done with a script . Here is an example.
    The script is at the site head. It is not a very beautiful solution but works for me.
    You choose the variant to force to view by specifying its width in the script (replace the 640 with the width of your main variant).
    Maybe I should mention that it doesn't work when started from a local file in Chrome and Opera, but it works fine in preview.
    Attached Files Attached Files

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •