Thread: Changing theme on request
Created on: 04/07/11 05:40 AM
| New topic Reply | Page: 1 |
| Replies: 5 | |
| thecfguy
|
04/07/11 5:40 AM Hi All, I am working on theme for mobile device using jQuery Mobile and I wanted to enable this theme whenever user visiting blog through mobile device. What thought going in my mind is... I will create plugin will check request from mobile device and change theme to mobile.. Can anyone know how to change theme for specific request/user? Thanks Pritesh |
| Link | Top | Bottom | |
| visual28
Wizard |
04/07/11 7:48 AM Just an FYI. This plugin is currently under development by another mango blog user not too sure how long it will be before it is done, but it is coming. Now to answer your question specifically. There are several ways you can handle this. One way is to use javascript to determine your browser type, and redirect the user to a different set of templates. I think this is how the plugin being developed is going to work. It can be used by anyone with any theme. jquery mobile (as I understand it) was created originally to work in conjunction with your existing theme, leveraging html5 hooks to handle the theaming. But this requires you to modify your sites theme. For that you would need to refer to the jquery mobile docs. Lastly, you can use media queries to determine viewport size and display your site formatted for various screen sizes. This is just plain old css and has nothing to do with jquery mobile, but it maintains your sites brand. - Mark - www.visual28.com | www.mangowear.com
|
| Link | Top | Bottom | |
| thecfguy
|
04/07/11 7:57 AM Thanks for your reply. I am aware of jQuery Mobile and skin ready to use (at beta level). I belive that skin/theme selection maintained at Application level and if I change skin to another skin it will applies for all users. What I need is blog use MOBILE theme only if blog visited through mobile device. |
| Link | Top | Bottom | |
| visual28
Wizard |
04/07/11 8:33 AM Then you will need to use javascript or Coldfusion to determine if the device is mobile and redirect to your new theme template. take a look at http://detectmobilebrowser.com/ as it might help. - Mark - www.visual28.com | www.mangowear.com
|
| Link | Top | Bottom | |
| thecfguy
|
04/07/11 8:37 AM Thanks for link. This is also I taken care of, my issue more related to Application and may be Laura can give me proper answer. Or may be I am not able explain my question properly. Thanks for your time. |
| Link | Top | Bottom | |
| Laura
Wizard |
05/10/11 7:10 PM Skin cannot be changed per request, but if you replace all top level cfm files from here: http://code.google.com/p/mangoblog/source/browse/#svn%2Ftrunk%2Fsrc%2Fcoldfusion%2Fapplication you can make a plugin that listens to the corresponding beforetemplate event (ie: beforeAuthorTemplate, beforeArchivesTemplate, etc) and change the request.skin data ( event.getRequestData().skin ) to what you need. I believe Adam Tuttle is working on the exact same plugin. |
| Link | Top | Bottom | |
New Post