Skip to content

could device_view functionality be optionally session based? #5

Open

Description

@HenriVesala

Current problem is that when user visit the sit with mobile and he decides to check full page version he is stuck with full page version unless he manually switches back.
I think that it would be logical to always redirect new mobile sessions to mobile page.

Activity

  1. suncat2000 commented on Sep 25, 2012

    @suncat2000
    Owner

    You offer good ideas, but the next month I will have very little time. You can do PR's or I can add you to the list of collaborators. Together productively!
    If you are interested?

  2. HenriVesala commented on Sep 25, 2012

    @HenriVesala
    ContributorAuthor

    Yeah. I have bit similar situation ongoing but I shall make PR's in the future if I have time.
    You can also add me to collaborator if you like.

  3. HenriVesala commented on Oct 9, 2012

    @HenriVesala
    ContributorAuthor

    This feature wasn't included in my PR and is still in todo list.

  4. suncat2000 commented on Oct 9, 2012

    @suncat2000
    Owner

    Ok
    I hastened )

  5. gnikyt commented on Mar 22, 2013

    @gnikyt

    Is this going to be added? This is an issue I had as well where the cookie kept the user on the full version and they'd have to manually switch back.

    My work around for now is:

            if ($mobile_detector->isMobile()) {
                $response = new Response;
                $response->headers->clearCookie(DeviceView::COOKIE_KEY);
                $response->send();
            }

    In the controller, might not be the best way but session based would definately be good!

  6. HenriVesala commented on Apr 11, 2013

    @HenriVesala
    ContributorAuthor

    Currently I don't have any need for this feature so I think nobody is working on it.
    Feel free to make pullrequest if you have solution.

  7. tobias-r commented on Jan 24, 2014

    @tobias-r

    I also need this feature. Can't you guys just solve it with Cookie Lifetime?

    Now we have 30 days, just change it to expire=0 and we're all set?

  8. netmikey commented on Jun 28, 2014

    @netmikey
    Collaborator

    I think we'd need a way to get back to the mobile view (or in other words: to the default device behaviour), regardless of cookie lifetime or whether the view overwriting is attached to the session.

    I found another workaround that seems to work: I included the following at the very bottom of my "desktop" template:

    {% if is_mobile() %}
        <a href="?device_view=mobile">
            To mobile version &raquo;
        </a>
    {% endif %}
    

    Thanks to the is_mobile() check, this will only ever be displayed if a mobile device displays the full version (which only happens when the view is overridden).

    Applying this trick in your mobile template could also be helpful to give accidental desktop visitors a chance of reaching the corresponding full desktop page (though #43 would be nice, too :)).

  9. added a commit that references this issue on Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions