I'm surprised, I haven't seen much activity in the forums about using Contao on mobile devices. I have a few websites running Contao and I'm interested in developing their mobile counterparts. Now that TL 2.9 has the Theme management, this seems to be a lot easier. My big concern is, I would like to use the same content I'm showing on my website on my mobile site. This way, a change in one place would change the other.
I have currently set up my mobile site as follows:
- Created a second web route and applied the domain name http://www.mydomain.mobi. With this, I can use Thyon's redirect module to detect if someone is using a mobile device and redirect them to the mobile domain name.
- Then Created all of my mobile site structure pages under my new mobile route. These pages would be named the same and use the same alias as my regular pages.
so regular site about page: http://www.mydomain.com/about.html
mobile site about page: http://www.mydomain.mobi/about.html
The Articles would be made and instead of creating new articles. I want these to reference the original ones so a change in one place would change in both. I did this by setting up the "Article Alias" element types. In some cases using the entire article alias wouldn't work, so I setup individual "Content Alias" element types. Either way, these are referencing the original site so changes can be made to both.
- Created a new theme/css/modules/templates to accommodate how the information will be shown differently on my mobile site. For instance, I have Left navigation on my regular website which wouldn't work on my mobile site. So I put the navigation into a drop down by changing the nav_default.tpl file.
This setup seems to be working for the most part, but there are still issues:
- The biggest downfall is you have to create two versions of your pages. This isn't the end of the world for me personally, but it is going to be a challenge trying to teach my clients how to make a new page on their regular website, add content to the page and then make a duplicate page on the mobile site and make sure they alias it correctly.
- Image sizes are the same size on both sites. So if I have an image that's 500 px wide, it breaks my 320 px mobile version. I'm still trying to decide what the best approach is for this but I think it would be setting up a script that says if there's an image over "x wide", convert it to "320px wide". I've noticed this also applies to form fields.
- News Readers, Calendar Readers, FAQ Readers, etc. have issues when jumping from the list to the reader with the "read more". Basically, because you setup the News Reader Jump to page at the news level, you cannot use the same news for both sites by default. We have currently built a module that overrides this however. It's not production ready but the basic idea is you are allowed to set a second redirect to the jump to page depending on a specific domain name. So we set it up so that "www.mydomain.mobi/news.html" can go to a different jump to page than "www.mydomain.com/news.html".
I was wondering if anyone had other ways to setup a mobile site in Contao? I am currently looking into ways to set up a second site without setting up a second route page and duplicating the site structure and articles.
I look forward to hearing what other people are doing
Justin
Bookmarks