mobile site cleanup reducing the code errors and fixing behaviours in cisco mobile sites
DESCRIPTION
Where is it? The code for the UKI mobile site comes from index.xml file located at l/uk/index.htmlTRANSCRIPT
Mobile Site Cleanup
Reducing the code errors and fixing behaviours in Cisco Mobile
sites
Mobile Site
• Mobile site must have valid code and
• Detection and Redirection Javascript on the homepage
• www.cisco.com/web/UK/
Where is it?
• The code for the UKI mobile site comes from index.xml file located at
www.cisco.com/web/mobile/global/uk/index.html
HTML includesThe index.xml file in UKI pulls together the following HTML includes.
• /web/mobile/global/uk/fw/h/header_start.html• /web/mobile/global/uk/t_index.html• /web/mobile/global/uk/fw/c/global_md.css• /web/mobile/global/uk/fw/h/header_end.html• /web/mobile/global/uk/c_index.html• /web/mobile/global/uk/fw/h/footer.html
These come together in Documentum to produce the final mobile index.html page.
Changing the xml• You can change the xml
file to call HTML includes from any place. Currently in most global mobile sites the xml points to US header and footer html files, while content is localized to the respective country
Problem?
• Harnessing the US mobile site code is fine……unless you are trying to get your mobile site indexed for paid search in a search engine.
• E.g. O2 mobile refused to index the UKI mobile site when it used US code….why? Because O2 noted that the US code has 47 errors.
Bad Code
• Originally the US code had 47 errors
• It still has 11 errors.• You can test your
own country site using the HTML validator
• http://validator.w3.org/
Solution• If you do have large number of errors on your mobile
site, use the W3 validation tool to locate them.• Some corrections you can make locally in this way.• Also point your header and footer include files to the UKI
versions as these have already been cleaned.• Then all you need to do is worry about cleaning the code
in your c_index.html and t_index html files which are already hosted on your local server.
So in effect you are just changing the html files which are being called by the xml – see below where the US include on the left is substituted
buy the UK url on the right.
The W3 Validation tool will trouble shoot each individual code problem. When a site is valid the red turns green.
Redundancy• The Web – because of the gradual evolution of HTML script is rarely
100% valid. Even in the UKI site we have had to leave 2 errors because fixing them would affect the look and feel of the site.
• Actually the second error cannot be solved as it is a problem with WCMx – (insertion of an empty line at the start of code causes an xml declaration error.)
But not to worry• Because code does not have to be 100% perfect.• It just needs to be better.• Most Engines will accept error thresholds of approximately “20%”
And Finally…
Add this code to the home page:• edit the file hp_includes/head_title_meta.shtml, in
CCEWP and add the following lines and update the country code (in red below) before pushing the file live :
• <script type="text/javascript">var mobileSite = “uk";</script><script type="text/javascript" src="http://www.cisco.com/web/mobile/global/script/redirect.js"></script>
• This redirects mobile devices from the home page to the Mobile home page