Lala Consulting is proud to offer a series of programs to inform our customers about all of the services we provide Currently we have two ongoing programs: In Your Shoes Support Program and Lala University.
Next, we introduce the opening body tag and set up the various containers in our page All content will live within a div with an ID of container Next, we have the page header followed by the start of the main content section The main content section has a page title in an h1 tag These header tags are important for search engine optimization, as well as for letting your readers know what's on the page This title is followed by an introductory paragraph In Your Shoes SupportThe In Your Shoes Support Program offers monthly webinars, a Quarterly Newsletter and an annual Lala Customer Conference
Lala UniversityLala University provides Employees, Distributors, and Partners with access to the most current information available Classes are taught either on-site or at a convention center Class size can range from to 500.
Customer Conference 2010 [ 54 ] For More Information: www.PacktPub.com/microsoft-sharepoint-2010-enterprise-applications-onwindows-phone-7/book ChapterLala is excited to announce the 3rd Annual Lala Customer Conference will be held this June at a location to be determined.
The main content continues with three articles Each article has a title and a paragraph of explanation Next, we have the sidebar that contains the main navigation for the site The navigation is a simple unordered list This will make it really easy for us to style for both the desktop and for Windows Phone © Copyright 2010 Lala Consulting Finally, we end the page with a footer containing the copyright information and close out the rest of our tags This page is just your typical two column fixed width page with a header and a footer There's nothing really special here It's just the content of the site, and that's the point here Your content shouldn't be different just because you have a desktop version of the site and a mobile version of the site Thought went into the order of content though The main content of the page is more important than the main navigation; because of that, the main content appears before the sidebar containing the main navigation code However, as you'll see, on the desktop they are rendered side by side with the navigation on the left [ 55 ] For More Information: www.PacktPub.com/microsoft-sharepoint-2010-enterprise-applications-onwindows-phone-7/book Getting Started with Internet Explorer Mobile Style.css The following is the code for style.css This code represents your typical cascading style sheet Some people prefer to have a separate reset file that contains every element under the sun and they reset it to some pre-defined baseline I prefer to reset only the values I actually use in the page Beyond the reset, the next interesting thing to point out is the use of points for fontsize This ensures that when the text is resized in the mobile browser it scales well html, body, div, h1, h4, p, ul, li , a { margin:0; padding:0; border:0; vertical-align:baseline; background:transparent; } We start the main style sheet with a bit of code to standardize all of the elements we use in the site: body { font:10pt sans-serif; line-height:1.22; background-color: #CEC7C6; } #container { margin: auto; width: 960px; } #header { font-size: 5em; background-color: #9CB6D6; width: 100%; text-align: right; } #main { [ 56 ] For More Information: www.PacktPub.com/microsoft-sharepoint-2010-enterprise-applications-onwindows-phone-7/book Chapter width: 100%; height: auto !important; min-height: 400px; background-color: #94927B; } Next, we specify some styles for the page as a whole, the header and the main content area: #mainContent { float: right; width: 840px; } #mainContent h1 { font-size: 2.0em; margin: 20px 10px 20px 10px; color: #D8D8D8; } #mainContent h4 { font-size: 1.3em; text-transform: capitalize; color: #D8D8D8; margin: 10px; } #mainContent p { font-size: 1.0em; color: White; margin: 10px; } Next, we specify that the main content area has a width of 840px and floats to the right We specify some styles for the h1, h4, and p tags to give them the style we are looking for on this site: #sidebar { float: left; width: 120px; [ 57 ] For More Information: www.PacktPub.com/microsoft-sharepoint-2010-enterprise-applications-onwindows-phone-7/book Getting Started with Internet Explorer Mobile background-color: #F7E7BD; height: auto !important; min-height: 400px; font-size: 0.8em; } #sidebar ul { margin: 0; padding: 20px 0 15px; list-style: none; } #sidebar ul li a.navOn { color: Red; } We then specify the sidebar style information The sidebar floats to the left and is 120px wide Also, the unordered list for our navigation elements is set to not have a list style: #footer { clear:both; background-color: #B59A73; padding: 20px 0 20px; } article { display: inline; width: 400px; float: left; } Finally, we specify that the footer should be clear of either the main content area or the sidebar This ensures that it will be below both of those Also, we specify that the articles are displayed inline They will flow from left to right until there's no more room and then break to a new line This CSS is fairly standard; there is no need to have wild style sheets for every version of Internet Explorer This is especially true if we develop on Internet Explorer and then test the site and tweak for other desktop browsers [ 58 ] For More Information: www.PacktPub.com/microsoft-sharepoint-2010-enterprise-applications-onwindows-phone-7/book Chapter Mobile.css Properly built CSS for the desktop version of the site will lend itself to ensuring the CSS for our mobile version is small In the following code for mobile.css only those selectors that need to be overridden are specified: #container { width: 100%; } #mainContent { width: 100%; } #mainContent p { width: 100%; font-size: 1.2em; } #sidebar { float: none; width: 100%; background-color: #F7E7BD; height: auto !important; min-height: 40pt; font-size: 1.2em; } #sidebar ul { width: 100%; padding: 5pt 0; } #sidebar ul li { display: inline; float: left; padding: 10pt; } #sidebar ul li a.navOn [ 59 ] For More Information: www.PacktPub.com/microsoft-sharepoint-2010-enterprise-applications-onwindows-phone-7/book Getting Started with Internet Explorer Mobile { color: Blue; } article { display: block; float: none; } An important thing to notice here is the measure of units used Purposely, avoid using absolute measurements, such as pixels This will allow the Windows Phone browser to resize the content in a way that will be more to the satisfaction of the user Desktop view The following screenshot shows what the support.aspx page looks like in Internet Explorer 8: [ 60 ] For More Information: www.PacktPub.com/microsoft-sharepoint-2010-enterprise-applications-onwindows-phone-7/book Chapter Notice that for this example, we've gone truly barebones The site doesn't have any images or backgrounds that we'd put in a real website The navigation is simple and appears on the left side of the main content The links are small and close together This stops the eye from being drawn to the navigation, and instead puts the visual emphasis on the main site's content Although this isn't a real website, the code provides enough of the core concepts needed to get started with building out the mobile version of the site Windows Phone view It is important enough to keep repeating; the purpose of a version of a website for Windows Phone 7's Internet Explorer Mobile is to get the relevant information in front of the user quickly and without any fluff A mobile user is on the go and shouldn't have to wade through menus and scroll a thousand times just to get to the main page content For that reason, I've kept this example really simple One thing to note is that we could easily add some JavaScript like this: function toggle(me) { var content = me.srcElement.nextSibling; if (content.style.display === "none") content.style.display = "block"; else content.style.display = "none"; } var articles; if (document.getElementsByClassName) articles = document.getElementsByClassName("article"); else articles = document.getElementById("mainContent") getElementsByTagName("div"); for (var i = 0; i < articles.length; i++) { if (articles[i].childNodes[0].addEventListener) articles[i].childNodes[0].addEventListener ("click", toggle, false); else articles[i].childNodes[0].attachEvent("onclick", toggle); articles[i].childNodes[1].style.display = "none"; } [ 61 ] For More Information: www.PacktPub.com/microsoft-sharepoint-2010-enterprise-applications-onwindows-phone-7/book Getting Started with Internet Explorer Mobile This would go through and find all elements in the page with a class name of article and then toggle the visibility of the paragraph based on a click of the title This also demonstrates the use of testing for functionality rather than for specific browsers IE8 doesn't have the function document.getElementsByClassName, but Internet Explorer Mobile does have it Also, the way events are attached to Internet Explorer differs from the way that other browsers handle this It takes a little bit of code to ensure functionality is the same for many browsers, but it is a lot less code than trying to figure out all the different browsers that could potentially have each feature Although this is a neat thought experiment, it should be noted that something like this should only be done when the number of items on the page would benefit from collapsing content The following screenshot shows the Windows phone view of the support.aspx page: [ 62 ] For More Information: www.PacktPub.com/microsoft-sharepoint-2010-enterprise-applications-onwindows-phone-7/book Chapter This has been just a simple example of what can be done with common content and a couple of CSS files Although this chapter has focused on web pages that are not connected to SharePoint, all of the information presented within will help when we turn our attention to SharePoint for the rest of this book Summary In this chapter, you learned the basics of web page architecture This architecture consists of finely crafted HTML, CSS, and JavaScript Using these three elements can result in pages that are mature and flexible enough to provide a display on both a desktop and a mobile device Internet Explorer Mobile for Windows Phone was introduced As were the new features of JavaScript, including the following: document.getElementsByClassName querySelector(selector) querySelectorAll(selector) These new improvements will enhance the speed of DOM manipulation of which many common programs take advantage Next the new CSS property: –ms-text-size-adjust was described and shown to not be used when the viewport meta tag is used Finally, the META tags used in handheld devices were described and how to utilize them in websites These META tags are as follows: HandheldFriendly MobileOptimized Viewport Of the three, Viewport is the most flexible and popular today We put all of this together into a simple sample page that demonstrated how a simple page built for a desktop browser could be transformed to display relevant information to a client in Internet Explorer Mobile This application showed the desktop rendering, as well as the mobile rendering It used server side browser detection to decide if the IEMobile version of the CSS should be displayed It also showed how to lay out the content, so that the important information is at the top of the page and the less important information is located at the bottom [ 63 ] For More Information: www.PacktPub.com/microsoft-sharepoint-2010-enterprise-applications-onwindows-phone-7/book Getting Started with Internet Explorer Mobile In the next chapter, we will start down the path of SharePoint 2010 by looking at SharePoint sites We will investigate the larger picture of SharePoint, how it is structured and how to set up our development environment Finally, we'll look at building a sample SharePoint site template and use it to create a new site [ 64 ] For More Information: www.PacktPub.com/microsoft-sharepoint-2010-enterprise-applications-onwindows-phone-7/book Where to buy this book You can buy Microsoft SharePoint 2010 Enterprise Applications on Windows Phone from the Packt Publishing website: http://www.packtpub.com/microsoftsharepoint-2010-enterprise-applications-on-windows-phone7/book Free shipping to the US, UK, Europe and selected Asian countries For more information, please read our shipping policy Alternatively, you can buy the book from Amazon, BN.com, Computer Manuals and most internet book retailers professional expertise distilled P U B L I S H I N G www.PacktPub.com For More Information: www.PacktPub.com/microsoft-sharepoint-2010-enterprise-applications-onwindows-phone-7/book ... www.PacktPub.com /microsoft- sharepoint- 2010- enterprise- applications- onwindows -phone- 7/ book Microsoft SharePoint 2010 Enterprise Applications on Windows Phone Microsoft Windows Phone is a reinvention of the Windows Mobile platform and... buy Microsoft SharePoint 2010 Enterprise Applications on Windows Phone from the Packt Publishing website: http://www.packtpub.com/microsoftsharepoint -2010- enterprise- applications- on- windows- phone7 /book... name="MobileOptimized" content="480" /> [ 50 ] For More Information: www.PacktPub.com /microsoft- sharepoint- 2010- enterprise- applications- onwindows -phone- 7/ book Chapter Windows Phone devices have a screen resolution