garethtdavies / detect-mobile

Lightweight PHP plugin for EE2/EE5 that detects a mobile browser using the PHP Detect Mobile class

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request for isnotphone tag

sm9 opened this issue · comments

Hi Gareth,

This plugin has the {exp:detect_mobile:isphone} tag. It'd be nice if there was also a {exp:detect_mobile:isnotphone} tag too (and I guess, a not equivalent of any other tags that exist, if they don't have one).

We could then use these in simple conditionals, without having to use the advanced if:else conditionals (which I think, has performance benefits).

Thanks,

Stephen

@sm9 !$detect->isMobile() does the job. There is no other way. Not sure how to do this in EE2.

Thanks Serban, I should have thought of that! I just saw the isnotmobile tag and assumed there would be 'isnot' versions for everything.

You're right though - I can probably do something like, {if "{exp:detect_mobile:isphone}" != ""} instead.

Thanks,

Stephen

Hi,

Sorry, I wasn't getting notifications for this repo and completely missed this. I've just merged in a pull request which adds the isnotphone method so use as {exp:detect_mobile:isnotphone}

No worries Gareth, and thanks for adding it. :)