Skinning for Mobile Devices questions
I would like to make a skin that works for mobile devices. I would like to use zero modules if possible to perform the tasks I think will be required. I have come up with a list of questions that I think I need to find the answers to before I can get started. I think maybe a blog or tutorial on someone’s site would be nice if anyone is looking for a topic to write on.
If the community could think of any points I may be missing, have answers to any of them, or can point me to some free samples works or tutorials on whatever you think may be required I would greatly appreciate it.
The site I’m working on is the most complex I’ve attempted so far. The time frame is somewhat casual. I want to do it as right as possible, staying as close to the DotNetNuke supported modules and core. So far I’ve really only butchered up some of the DNN graphics included in Extropy, but I would like to add mobile functions for Blogs and Forums to the site, and eventually user profiles if I can find something that fits my need best. The site in question is located at
http://www.MusicianHouse.com It’s up and running, pretty bare, and looks almost identical to the default setup with just a few text changes. This will be customized further, but that’s the easy part :->
Plan of Action:
- Style-Sheet.
- I will need to change the style sheet depending on the user agent string, using Java-script.
- I have found a sample script1 that accomplishes the detection. The question becomes, how do I actually perform the swap without user intervention. I will be examining extropy to see how they do it on the accessibility buttons, but again, no user intervention should be required.
- Is this a function that J-query can be used to do the swap on.
- Am I able to direct the css to be linked in the head of the doc, or will I be throwing more W3C error?
- Do I keep the old style sheets linked and hope that the new one overrides, or can I unlink the old one using j-query functions?
- XHTML document.
- I prefer to write the HTML docs rather than the ascx, as I can then take advantage of the XML files that I have already written and customized so that they make sense to me.
- When switching would it be better to detect and load a different HTML doc and style-sheet, or just resize everything.
- I’d LIKE to do an order list, but I do not want to use HouseMenu, no offence, it’s a great free product. Can I use DNNMenuNavigation to create a non-graphical ordered list effect?(I bet I can).
- What if I have to use diffeent ascx skins for mobile devices rather than the normal site skins. What are the troubles that will arise, and what are some possible stumbling blocks?
- I have this nagging thought that it’s going to blow up :->. If the normal IE version is say Left Pane, Right Pane, Top Pane, Bottom Pane, and content pane….and I load a skin for mobile devices that is just a content pane….does DotNetNuke retain the module positions on the first skin, are my normal IE users going to suddenly see my whole side dump into the content pain, or will it just take effect when the agent is mobile?
- I think what I would do to avoid any possible side effects, is just stack the same panes one on top of another, so that each skin has the same number of panes, but all in one column for the IPHONE. Then I can balance the positions to allow for proper display on each browser.
- The nice snap effect on the Iphone. When you double click text on well written sites it zooms resizes and snaps everything so that it fits on the screen, so there is no side to side scrolling, just up and down. I haven’t looked at any details of any of these sites yet, but I’m assuming it just zooms <p> tags to balance it out correctly.
- What about skinning the blog and forums modules, can I go so far as to control (easily), how the data is presented in those modules. Meaning, I want to make sure that everything is wrapped exactly how the Iphone and other mobile devices are, especially blog content, and forums, so that we get that snapping effect.
OK…that’s all I can think of right now….please let me know if I’m too wordy :->, and if you have any good pointers, or can resolve some of my fears.
Thanks
Josh
1. <Sample Script>
var nVer = navigator.appVersion;
var nAgt = navigator.userAgent;
var browserName = navigator.appName;
var fullVersion = ''+parseFloat(navigator.appVersion);
var majorVersion = parseInt(navigator.appVersion,10);
var nameOffset,verOffset,ix;
// In MSIE, the true version is after "MSIE" in userAgent
if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
browserName = "Microsoft Internet Explorer";
fullVersion = nAgt.substring(verOffset+5);
}
// In Opera, the true version is after "Opera"
else if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
browserName = "Opera";
fullVersion = nAgt.substring(verOffset+6);
}
// In Chrome, the true version is after "Chrome"
else if ((verOffset=nAgt.indexOf("Chrome"))!=-1) {
browserName = "Chrome";
fullVersion = nAgt.substring(verOffset+7);
}
// In Safari, the true version is after "Safari"
else if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
browserName = "Safari";
fullVersion = nAgt.substring(verOffset+7);
}
// In Firefox, the true version is after "Firefox"
else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) {
browserName = "Firefox";
fullVersion = nAgt.substring(verOffset+8);
}
// In most other browsers, "name/version" is at the end of userAgent
else if ( (nameOffset=nAgt.lastIndexOf(' ')+1) < (verOffset=nAgt.lastIndexOf('/')) )
{
browserName = nAgt.substring(nameOffset,verOffset);
fullVersion = nAgt.substring(verOffset+1);
if (browserName.toLowerCase()==browserName.toUpperCase()) {
browserName = navigator.appName;
}
}
// trim the fullVersion string at semicolon/space if present
if ((ix=fullVersion.indexOf(";"))!=-1) fullVersion=fullVersion.substring(0,ix);
if ((ix=fullVersion.indexOf(" "))!=-1) fullVersion=fullVersion.substring(0,ix);
majorVersion = parseInt(''+fullVersion,10);
if (isNaN(majorVersion)) {
fullVersion = ''+parseFloat(navigator.appVersion);
majorVersion = parseInt(navigator.appVersion,10);
}
document.write('Browser name = '+browserName+'<br>');
document.write('Full version = '+fullVersion+'<br>');
document.write('Major version = '+majorVersion+'<br>');
document.write('navigator.appName = '+navigator.appName+'<br>');
document.write('navigator.userAgent = '+navigator.userAgent+'<br>');
[CODE SAMPLE FROM: http://www.javascripter.net:80/faq/browsern.htm]