Mobile Detection Add [isnt_computer]
-
Hi Eliot,
Is it possible to add to the mobile detection options [isnt_computer]?
So that this would encompass anything that is a phone, mobile, and tablet?
Thanks
-
Hello,
Sure, I added it in the latest plugin update. Also, I updated the Mobile Detect library.
I haven’t tested this feature extensively. I would really appreciate if you could give me some feedback from your tests. 🙂
It seems to work in recognizing and iphone 4s on ios 6, and an ipad 2 on ios 7.
Interestingly though it doesn’t seem to function properly on my home page.
http://www.alexandersharkey.photography/Here is an example using the new [isnt_computer]
http://www.alexandersharkey.photography/?page_id=329Coded the same way as the home page but the home page shows both the normal content as well as the [isnt_computer] content.
This does the same thing with [is_phone] but again only on the home page. (i’ll actually be using the [is_phone] for the home page, and [isnt_computer] for other pages)
This is making me think it’s on my end and not your plugin.
Any advice?
I looked at both pages – they seem to be detecting the same: on the document body, I see isnt_phone and is_computer.
Hmm.. Is it possible that you’re not closing the shortcode tags correctly?
[is_computer] ... [/is_computer] [isnt_computer] ... [/isnt_computer]i looked at the developer bar in firefox and see what you are referencing:
This is what i have typed in the pages:
This is for page http://www.alexandersharkey.photography/?page_id=329<div id=”jb-container”>
<div class=”jb-wrap”>[xyz-ihs snippet=”Nautical”]</div>
</div>
[isnt_computer]
[redirect]http://www.alexandersharkey.photography/4.html#expanded[/redirect]
[/isnt_computer]this is for the home page
<div id=”jb-container”>
<div class=”jb-wrap”>[xyz-ihs snippet=”0Portfolio”]</div>
</div>
[is_phone]
<h4 style=”text-align: center;”><span style=”text-decoration: underline;”>VIEW PORTFOLIO</span></h4>
[/is_phone]So..to help me understand the issue, the expected behavior is:
1) Page – If it’s a tablet or phone, redirect to another page: iPhone and iPad
2) Home – if it’s a phone (not tablet or bigger) then display something: only iPhoneIs that correct? And can you tell me what it’s doing instead?
that is exactly correct
for my photo gallery pages (images by genre, or images by place) i have your plugin redirect an iOS user to an expanded fullscreen mode of the juicebox gallery (photo slideshow)
For the home page on a computer and tablet i have it configured to show the juicebox gallery normally. But for an iphone, the juicebox gallery isnt very mobile friendly so that is why i have your plugin show the hyperlink “View Portfolio” which in turn takes them to the expanded fullscreen page of the juicebox gallery.
Let me know if that makes sense
OK, I see, so that’s the expected behavior – and could you describe to me the issue on the home page?
You said earlier: “the home page shows both the normal content as well as the [isnt_computer] content. This does the same thing with [is_phone] but again only on the home page.” This part is not clear to me. Is the issue with [is_phone]..?
Sorry for the confusion.
So on an iphone the homepage should only display the hyperlink “view portfolio” which rests inside the [is_phone] tag
However it is showing the hyperlink inside [is_phone] as well as loading the jb-container. here is my html below:
<div id=”jb-container”>
<div class=”jb-wrap”>[xyz-ihs snippet=”0Portfolio”]</div>
</div>
[is_phone]
<h4 style=”text-align: center;”><span style=”text-decoration: underline;”>VIEW PORTFOLIO</span></h4>
[/is_phone]In that case you would probably want to do something like this:
[isnt_phone] <div id="jb-container"> <div class="jb-wrap">[xyz-ihs snippet="0Portfolio"]</div> </div> [/isnt_phone] [is_phone] <h4 style="text-align: center;"><span style="text-decoration: underline;">VIEW PORTFOLIO</span></h4> [/is_phone]That should hide the portfolio on phones.
That did fix it.
Great, so in the same way, you can use [is_computer] and [isnt_computer] on the other page.
The topic ‘Mobile Detection Add [isnt_computer]’ is closed to new replies.