HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Hybrid mobile version

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#94507 (In Topic #18836)
Avatar

Community saint

Hi,

Some of my users are complaining of poor performance when using an iPhone 4 on our OCP site.
vwgolfmk1.org.uk

These are mainly non technical users that find the forums very slow to type in.
They are using the full site rather than the mobile site because they much prefer the look and feel of the main pages and are happy to zoom in and out around it.

This got me thinking that it would be really good to offer a hybrid version of the site that only switched automatically to the mobile version when it made sense - like using the forums.

I have just been using the OCPortal site and discovered that it does the very same thing - in fact doesn't even offer the user a mobile / non mobile option.

Any chance of a brief outline of how this has been achieved?

I guess that I could remove the option to switch between them or offer a hybrid option.

How is it achieved on the main OCP site ?

Cheers,
Ade
Back to the top
 
Posted
Rating:
#94508
Avatar

Edit the settings of your theme, you can whitelist page names that run in mobile-mode (e.g. forumview,topicview,topics,start,downloads).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#94533
Avatar

Community saint

Do you know I totally missed that part of the configuration - there is so much in OCP !!

Cheers
Ade
Back to the top
 
Posted
Rating:
#96648
Avatar

Well-settled

Can anyone point me to how I can do this for a different zone, I have tried /zone:start and a few other things but can not get it to work.

I have a similar set up as Lhasadreams, with mobile mode kicking in on certain pages of the site, but also want this on different zones, this is most likely very easy to do but I can`t figure it out  O_o

Back to the top
 
Posted
Rating:
#96649
Avatar

Community saint

The selection of which pages are rendered using mobile are in the Theme attached to the zone and not the zone itself.
Back to the top
 
Posted
Rating:
#96650
Avatar

It's not actually got any special zone support. So you just use the page name. If you have a page in one zone named the same as one in another, and they aren't both white-listed as mobile pages, you could have a problem. I'll make a tweak for v10 which you could do now. In sources/support.php change:

Code

         if ((isset($details['mobile_pages'])) && ($details['mobile_pages']!='') && (preg_match('#(^|,)\s*'.preg_quote(get_page_name(),'#').'\s*(,|$)#',$details['mobile_pages'])==0))
to:

Code

         if ((isset($details['mobile_pages'])) && ($details['mobile_pages']!='') && (preg_match('#(^|,)\s*'.preg_quote(get_page_name(),'#').'\s*(,|$)#',$details['mobile_pages'])==0) && (preg_match('#(^|,)\s*'.preg_quote(get_zone_name().':'.get_page_name(),'#').'\s*(,|$)#',$details['mobile_pages'])==0))

You can then put in zone:page instead of just page, for extra precision.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#96651
Avatar

Well-settled

Lhasadreams said

The selection of which pages are rendered using mobile are in the Theme attached to the zone and not the zone itself.

Ade
I had worked this out by following this post you created and looked at the work you had done on the car site (its a lot easier to follow the work already created then do it from scratch, thanks for that :$ )



Chris Graham said

It's not actually got any special zone support. So you just use the page name. If you have a page in one zone named the same as one in another, and they aren't both white-listed as mobile pages, you could have a problem. I'll make a tweak for v10 which you could do now. In sources/support.php change:

Code

         if ((isset($details['mobile_pages'])) && ($details['mobile_pages']!='') && (preg_match('#(^|,)\s*'.preg_quote(get_page_name(),'#').'\s*(,|$)#',$details['mobile_pages'])==0))
to:

Code

         if ((isset($details['mobile_pages'])) && ($details['mobile_pages']!='') && (preg_match('#(^|,)\s*'.preg_quote(get_page_name(),'#').'\s*(,|$)#',$details['mobile_pages'])==0) && (preg_match('#(^|,)\s*'.preg_quote(get_zone_name().':'.get_page_name(),'#').'\s*(,|$)#',$details['mobile_pages'])==0))

You can then put in zone:page instead of just page, for extra precision.

Chris that was exactly what it was, I thought with it being a different zone you would have to reference the zone first.

I had been using just the zones:start page for what I had wanted as this is what it directs you to when first adding another zone, but now I will create seperate named pages as I was already using the start page on the main zone which I didnt want to show mobile on.

Thanks again
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: