New Landing How can we help? Atelier How to remove viewport maximum scale limit?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Posted in: Atelier
  • #226851
    mccaul
    Member
    Post count: 28

    Hi,

    I’d like to change the viewport metadata to remove the viewport zoom limitation of 1.

    My products have quite detailed parts, and not being able to pinch and zoom on a mobile device is quite frustrating.

    The atelier theme overrides the default swift viewport code with the following line:

    	function sf_atelier_viewport_content() {
    		return "width=device-width, initial-scale=1.0, maximum-scale=1"; //maximum-scale=1 added here.
    	}
    	add_filter('sf_viewport_content', 'sf_atelier_viewport_content');
    

    The last section ‘maximum-scale=1’, is what is causing the pages to not be zoomable on mobile.

    In theory I should be able to fix this by adding my own filter in functions.php to return a new value.
    like this:

    
    function sf_atelier_child_viewport_content() {
    	return "width=device-width, initial-scale=1.0";
    }
    add_filter('sf_viewport_content', 'sf_atelier_child_viewport_content', 10); 
    

    my function doesn’t seem to override the atelier one however, so I’m still getting the zoom.

    Would be grateful if somebody could help with this.
    Thanks,
    -Barry

    #226960
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please try to use this code:-

    remove_filter( 'sf_viewport_content', 'sf_atelier_child_viewport_content',90 );
    function sf_atelier_newcont() {
    	return "width=device-width, initial-scale=1.0";
    }
    add_filter('sf_viewport_content', 'sf_atelier_newcont', 22); 

    Thanks
    Mohammad

    #228426
    mccaul
    Member
    Post count: 28
    This reply has been marked as private.
    #228434
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Glad it’s sorted. Thanks Mohammad.

    -Rui

    #255939
    MKtheory
    Member
    Post count: 4

    I’m trying to do the same thing.. I want to be able to zoom on tablets and mobile devices. How can I do this with this theme.

    Thanks

    #256011
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    Please see comments above

    – Kyle

    #256529
    MKtheory
    Member
    Post count: 4

    its not working

    #256603
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please use this code:-

    remove_filter( 'sf_viewport_content', 'sf_atelier_viewport_content',90 );
    function sf_atelier_newcont() {
    	return "width=device-width, initial-scale=1.0";
    }
    add_filter('sf_viewport_content', 'sf_atelier_newcont', 22); 

    Thanks
    Mohammad

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register