<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;C0YHQn48eip7ImA9WhRaFEk.&quot;"><id>tag:blogger.com,1999:blog-4597579859901368488</id><updated>2012-02-16T20:12:13.072-05:00</updated><category term="Followers gadget" /><category term="Picasa" /><category term="Google Friend Connect" /><category term="Windows Live Writer" /><category term="Joomla" /><category term="Blogger" /><category term="Artisteer" /><title>The Coding Paparazzi</title><subtitle type="html">A technical blog on code and programming&lt;br&gt;
by Sylvain Lafontaine</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://coding-paparazzi.sylvainlafontaine.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://coding-paparazzi.sylvainlafontaine.com/" /><author><name>Sylvain Lafontaine</name><uri>http://www.blogger.com/profile/08439067731828915631</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_w76XuJflOGw/S0EvrjQTAqI/AAAAAAAAFc8/MeCzPdBteeg/S220/Sylvain+-+thumbnail,+carre,+54x54px,+version+3.png" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/TheCodingPaparazzi" /><feedburner:info uri="thecodingpaparazzi" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DUYNQ3s_eCp7ImA9WxBVGUw.&quot;"><id>tag:blogger.com,1999:blog-4597579859901368488.post-6483733455160189347</id><published>2010-02-16T04:33:00.001-05:00</published><updated>2010-02-23T04:26:32.540-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-23T04:26:32.540-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Windows Live Writer" /><title>Solving the connection problems of Windows Live Writer (WLW), Part 1</title><content type="html">&lt;script type="text/javascript"&gt;

  var id; // Deliberately unassigned variable: nécessaire si on veut           // réouvrir la même fenêtre tout le temps.

function w (t) {
  var hw;
  // hw = window.open ("about:blank", id, "")
  hw = window.open ("about:blank", "", "")

  // Le formatage des lignes sera conservé mais les codes HTML pour
  // &amp; " &lt; &gt; seront conservés tels quels.
  hw.document.open ("text/plain");
  hw.document.clear;

  var t2 = t.replace(/&amp;lt;/g, "&lt;").replace(/&amp;gt;/g, "&gt;").replace(/&amp;quot;/g, "\"").replace(/&amp;amp;/g, "&amp;");

  hw.document.write (t2);
  hw.document.close();
  return false;
}
&lt;/script&gt;  &lt;p&gt;Problems connecting to a blog site using Windows Live Writer (WLW) are common; especially for PHP based systems.&amp;#160; When this happens, you usually see an error message like this one:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&amp;#160; • An error occurred while attempting to connect to your blog: Invalid Server Response - The response to the blogger.getUsersBlogs method received from the web-log server was invalid. You must correct this error before proceeding.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;In this article, we'll see the measures that we can take to resolve many of these communication problems, especially those who are not already or are poorly explained on the Internet.&lt;/p&gt; &lt;a name='more'&gt;&lt;/a&gt;&lt;!-- more --&gt;  &lt;h3&gt;1- Introduction&lt;/h3&gt;  &lt;div style="display: none; background-color: #e0e0e0"&gt;   &lt;p&gt;Français:      &lt;br /&gt;Permalien: Solutionner problèmes connection WLW       &lt;br /&gt;&lt;a href="http://paparazzi-codeur.sylvainlafontaine.com/2010/02/solutionner-problemes-connection-wlw.html"&gt;Le Paparazzi~Codeur: Solutionner problèmes connection WLW - Partie 1&lt;/a&gt;       &lt;br /&gt;      &lt;br /&gt;Titre: Solutionner les problèmes de connection de Windows Live Writer (WLW), partie 1&lt;/p&gt;    &lt;p&gt;Anglais:      &lt;br /&gt;Permalink: Solving connection problems WLW       &lt;br /&gt;Title: Solving the connection problems of Windows Live Writer (WLW) - Part 1&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;The vast majority of the communication problems for WLW mentioned on the Internet are about blogging systems based on PHP scripts; not only because these systems are the most used (think about WordPress, Drupal and Joomla) but also sadly because of the way that web services - an essential component of protocols such as XML-RPC used by WLW - are implemented in PHP which makes them very sensitive to many type programming errors; even as small as an extraneous white line at the beginning or the end of a script file.&amp;#160; The rest of this article will deal only with communication problems related to PHP.&amp;#160; Of these blogging systems, WordPress (WP) is picking up the lion's share, so the examples used in this article are based on WP.&amp;#160; However, this doesn't mean that you won't find anything interesting here if you are using another blogging platform than WP.&amp;#160; Except for the first example that uses a common problem specific to WP to explain the log file of WLW, the majority of the explanations given here will fully apply to many other blogging systems using PHP.&lt;/p&gt;  &lt;p&gt;With the exception of a particular problem related to the uploading of images and video files, the vast majority of communication problems that you'll get with WLW will happen when you'll try to create a new account.&amp;#160; In these cases, you'll be greeted with the following error message &lt;em&gt;&amp;quot;An error occurred while attempting to connect to your blog: Invalid Server Response - The response to the &lt;strong&gt;blogger.getUsersBlogs&lt;/strong&gt; method received from the web-server log was invalid.&lt;/em&gt; &lt;em&gt;You must correct this error before proceeding.&amp;quot;&lt;/em&gt;.&amp;#160; Less often, and error will happen when you'll try to publish a new article using an account that was working correctly in the past. In these cases, the method &amp;quot;blogger.getUsersBlogs&amp;quot; will be replaced in the error message with other methods such as &lt;strong&gt;metaWeblog.newPost&lt;/strong&gt; or &lt;strong&gt;metaWeblog.getRecentPosts:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&amp;#160; &lt;em&gt;• &lt;/em&gt;The response to the metaWeblog.newPost method received from the web-log server was invalid.&lt;/em&gt; &lt;/p&gt;  &lt;p&gt;&lt;em&gt;&amp;#160; &lt;em&gt;• &lt;/em&gt;The response to the metaWeblog.getRecentPosts method received from the web-log server was invalid.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Obviously, if you can no longer publish an article using an existing account that was worked correctly before, it's quite probably because something has changed in the mean time and we can safely assume that if you now try to recreate this account, you will be greeted by the first error message, the one with &amp;quot;blogger.getUsersBlogs&amp;quot;.&lt;/p&gt;  &lt;h3&gt;2- metaWeblog.newMediaObject and other well-known problems&lt;/h3&gt;  &lt;p&gt;Before continuing, we will take a look as some of the most known problems of WLW that you'll find on the Internet. This will be only a quick look because I don't want to repeat what you can already find on the Internet and also because many of these are already a thing of the past; ie., they are no longer present in the latest versions of either WLW or of the blogging systems.&lt;/p&gt;  &lt;p&gt;The most important of these is an intermittent failure for uploading images, videos and other big media files and will usually occurs only when you will want to upload multiple files at once or a big one but not when uploading a few small files or a medium one. This problem is different from most of the other communication problems because in the mean time, all the other publishing features of WLW will keep working correctly.&amp;#160; You can identifie this problem by the presence of the &lt;strong&gt;metaWeblog.newMediaObject&lt;/strong&gt; method that will be in the error message: &lt;em&gt;&amp;quot;The response to the &lt;strong&gt;metaWeblog.newMediaObject&lt;/strong&gt; method received from the weblog server was invalid&amp;quot;&lt;/em&gt; and the name of this method says to us that the problem is clearly related to the creation of a new media file on the system and is not something like an invalid password.&lt;/p&gt;  &lt;p&gt;This problem happend when the uploading of your media files goes over the internal memory limits of PHP and can be fixed in different ways: by reducing the image size; by reducing the total number of uploaded files in a single time; by using FTP or by increasing the memory available to PHP for the execution a script.&amp;#160; To learn how to use FTP with WLW, take a look at the following article: &amp;quot;&lt;a href="http://www.troublefixers.com/solved-live-writer-error-the-response-to-the-metaweblog-newmediaobject-method-received-from-the-weblog-server-was-invalid-invalid-response-document-returned-from-xmlrpc-server/"&gt;Live Writer Error – The response to the metaWeblog.newMediaObject method received from the weblog server was invalid – Invalid Response Document Returned From XmlRpc Server&lt;/a&gt;&amp;quot;.&lt;/p&gt;  &lt;p&gt;For increasing the PHP memory limit, you must either change the value of the memory_limit parameter that you will find in your &amp;quot;php.ini&amp;quot; file (or add the line if this parameter is not already there) or you could also add the following line of code « &lt;strong&gt;ini_set (&amp;quot;memory_limit&amp;quot;, &amp;quot;12M&amp;quot;);&lt;/strong&gt; » (without the quotes «...», of course) right after the &lt;strong&gt;&lt;font color="#ff0000"&gt;&amp;lt;?php&lt;/font&gt;&lt;/strong&gt; characters in the PHP script that handles either the whole XML-RPC protocol or only the uploading of images and other medial files.&amp;#160; For example, in the case of WordPress, you could change the &lt;strong&gt;&amp;quot;wp-admin/includes/image.php&lt;/strong&gt; file.&amp;#160; You'll find more details about this in the article &amp;quot;&lt;a href="http://www.mydigitallife.info/2006/04/23/php-allowed-memory-size-exchausted-fatal-error/#comment-470471"&gt;PHP Allowed Memory Size Exchausted Fatal Error » My Digital Life&lt;/a&gt;&amp;quot;.&amp;#160; Also, the value of 12M above is your personal choice.&lt;/p&gt;  &lt;p&gt;Before going to the next round, here a few references that will provide the list of the most common known connection problems of Windows Live Writer (WLW); although many of these are old problems and no longer exist in the latest versions of WLW:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://codex.wordpress.org/Windows_Live_Writer_Help"&gt;Windows Live Writer Help « WordPress Codex&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.seo-scientist.com/wordpress-and-windows-live-writer-xmlrpc-server-problem-solutions.html"&gt;WordPress and Windows Live Writer XmlRpc server problem solutions | SEO Scientist - Applying the scientific method to SEO&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.mindtweaks.com/wordpress//?p=336"&gt;Update: Windows Live Writer Image Upload Issues — MindTWEAKS&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.mindtweaks.com/wordpress/?p=233"&gt;Fix For Problems between Windows Live Writer and Wordpress — MindTWEAKS&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;3 - The Log File of Windows Live Writer&lt;/h3&gt;  &lt;p&gt;When you have a problem communicating XML-RPC, the log file of Windows Live Writer (WLW) is probably the first place to look into. To explain its use, we will start by taking as an example a WordPress (WP) configuration error familiar its users and which usually - but not necessarily - happens right after a new installation.&amp;#160; Note that even if you don't use WP, the following discussion is still interesting because it's an introduction to the use of the WLW's log file.&lt;/p&gt;  &lt;p&gt;Since version 2.7 of WP, the XML-RPC remote communication protocol is not enabled by default on a new installation of WP. Therefore, if you forget later to activate it explicitly in the configuration options, WLW will obviously not be able to the WordPress server using the XML-RPC protocol and you will be welcomed with the following error message:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_w76XuJflOGw/S3pl3mhJcQI/AAAAAAAAFqQ/r58aHwMtEdY/s1600-h/captured_Image.png311.gif" target="_blank"&gt;&lt;img title="captured_Image.png[3]" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="208" alt="captured_Image.png[3]" src="http://lh3.ggpht.com/_w76XuJflOGw/S3pl4D64bsI/AAAAAAAAFqU/oxh-rfpNMDg/captured_Image.png3_thumb1.gif?imgmax=800" width="500" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This error message describes exactly the cause of the problem and clearly says that the XML-RPC remote communication protocol should be enabled; which can be done by going to the Admin Dashboard of WP under &lt;strong&gt;Settings&lt;/strong&gt; | &lt;strong&gt;Writing&lt;/strong&gt; | &lt;strong&gt;Remote Publishing &lt;/strong&gt;and then checking the box &amp;quot;&lt;strong&gt;XML-RPC - Enable XML-RPC protocols (WordPress, Movable Type, MetaWeblog, Blogger XML-RPC)&lt;/strong&gt;&amp;quot;&lt;strong&gt;.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In this example, identifying and correcting the source of the problem was relatively easy because an explicit error message has been provided to us by the system. However, the situation will be much less clear when, instead of getting an explicit error message, you get nothing but a generic error message that, excerpt for telling you that something got wrong, will provide absolutely no clue whatsoever about the nature of the underlying problem:&lt;/p&gt;  &lt;p&gt;&lt;img title="captured_Image.png" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="206" alt="captured_Image.png" src="http://lh6.ggpht.com/_w76XuJflOGw/S3pl4rAVT2I/AAAAAAAAFqY/aAUfRgw4pYc/captured_Image.png_thumb18.gif?imgmax=800" width="500" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&amp;quot;An error occurred while attempting to connect to your blog: Invalid Server Response - The response to the blogger.getUsersBlogs method received from the web-log server was invalid. You must correct this error before proceeding.&amp;quot;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;When we get this error message, you can either start trying at random solutions gleaned all over the internet - I do not recommend it and I don't think that you'll disagree with that, otherwise probably that you would not be here reading this - or go at the bottom of things and find what happens first before trying any solution and for this, there are two very effective tools: the first one is the log file of WLW and the second one would be to use an HTML protocol analyzer such as Fiddler. We shall see how to use Fiddler later but first, let's take a look at the log file of WLW.&lt;/p&gt;  &lt;p&gt;This log file is aptly called &amp;quot;&lt;strong&gt;Windows Live Writer.log&lt;/strong&gt;&amp;quot; and is created automatically by WLW in the directory &lt;strong&gt;&amp;quot;%USERPROFILE%\Local Settings\Application Data\Windows Live Writer\&lt;/strong&gt;&amp;quot; or &amp;quot;&lt;strong&gt;C:\Documents and Settings\__YOUR_USER_NAME__\Local Settings\Application Data\Windows Live Writer&lt;/strong&gt;&amp;quot; if you're running WinXP. In the case of Vista, you will find it in the directory &amp;quot;&lt;strong&gt;%localappdata%\Windows Live Writer&lt;/strong&gt;&amp;quot;.&amp;#160; To access this directory, you can of course Use Windows Explorer or you can open the command Start | Run and copy the desired address in the dialog, eg for WinXP:&lt;/p&gt;  &lt;p&gt;&lt;img title="captured_Image.png[7]" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="228" alt="captured_Image.png[7]" src="http://lh5.ggpht.com/_w76XuJflOGw/S3pl5DIyWCI/AAAAAAAAFqc/AOfHzfn23LQ/captured_Image.png75.gif?imgmax=800" width="403" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;An even simpler method would be to use the dialog box &amp;quot;About Windows Live Writer&amp;quot; of WLW; available from the menu &amp;quot;Help&amp;quot; and which contains a direct link to the directory behind the link &amp;quot;Show log file&amp;quot;; as shown in the figure below (red arrow):&lt;/p&gt;  &lt;p&gt;&lt;img title="captured_Image.png[1]" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="295" alt="captured_Image.png[1]" src="http://lh4.ggpht.com/_w76XuJflOGw/S3pl5uvHe6I/AAAAAAAAFqg/lAucQFOE03E/captured_Image.png19.gif?imgmax=800" width="400" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;By default, WLW will write only a few things in the log file but it will include at a minimum any error message. This is often sufficient in many cases but to get a better view of what happened, we can activate the verbose logging mode, which will greatly increase the amount of written information and will make things easier (or more complicated!) to understand. All the examples shown in this article have been based on using the verbose logging mode. To find out how to activate this mode for WLW, please consult the following reference: &amp;quot;&lt;a href="http://blogs.msdn.com/brandonturner/archive/2009/05/19/how-to-enable-verbose-logging-in-windows-live-writer.aspx"&gt;Donkblog : How to enable verbose logging in Windows Live Writer&lt;/a&gt;&amp;quot;.&amp;#160; Important: note that in the case of WLW, if you have multiple windows opened, there is still always only a single WLW processus to control them all; so you cannot change the verbose mode of WLW if you have already at least one open window so therefore, you must close any WLW windows before to be able to switch to the verbose logging mode.&lt;/p&gt;  &lt;p&gt;In order not to be lost in a mass of useless information, the first thing to do would be obviously to delete any previous log file that's already there in order to see only the most recent and relevant events after that. There is absolutely no problem deleting this file anytime, even when WLW is already open.&amp;#160; You can use any program such as Notepad or WordPad or your favorite text editor to open it and read it but as Notepad doesn't convert partial end of line (only chr(10) to full Windows end of line (chr(13)+chr(10)), it's a better idea to use WordPad instead; otherwise some stuff will be cramped on a single line instead of multiple lines.&lt;/p&gt;  &lt;p&gt;If we now repeat the same test as above with the XML-RPC remote publishing configuration error on a new installation of WordPress, this is what we'll find in the log file of WLW:&lt;/p&gt; &lt;form name="form1"&gt;   &lt;p style="margin: 10px 0px 8px"&gt;&lt;button class="art-button" onclick="javascript:document.form1.text_area.focus(); document.form1.text_area.select();"&gt;Select the source code&lt;/button&gt;&amp;#160;&lt;button class="art-button" onclick="javascript:w(document.form1.text_area.innerHTML);"&gt;Open in a new window&lt;/button&gt;&lt;/p&gt;    &lt;pre style="margin: 0px 0px 12px"&gt;&lt;textarea id="text_area" style="border-right: gray 1px solid; border-top: gray 1px solid; border-left: gray 1px solid; width: 580px; border-bottom: gray 1px solid; height: 260px" name="text_area" wrap="off"&gt;WindowsLiveWriter,5612,None,00011,15-Jan-2010 22:50:50.921,&amp;quot;499 499&amp;quot;,&amp;quot;&amp;quot;
WindowsLiveWriter,5612,None,00012,15-Jan-2010 22:51:52.250,&amp;quot;XML-RPC request:
http://sylvain2/BlogueWP1/xmlrpc.php
&amp;lt;?xml version=&amp;quot;&amp;quot;1.0&amp;quot;&amp;quot; encoding=&amp;quot;&amp;quot;utf-8&amp;quot;&amp;quot;?&amp;gt;
&amp;lt;methodCall&amp;gt;
 &amp;lt;methodName&amp;gt;blogger.getUsersBlogs&amp;lt;/methodName&amp;gt;
 &amp;lt;params&amp;gt;
  &amp;lt;param&amp;gt;
   &amp;lt;value&amp;gt;
    &amp;lt;string&amp;gt;[-- Encoded password removed --]&amp;lt;/string&amp;gt;
   &amp;lt;/value&amp;gt;
  &amp;lt;/param&amp;gt;
  &amp;lt;param&amp;gt;
   &amp;lt;value&amp;gt;
    &amp;lt;string&amp;gt;admin&amp;lt;/string&amp;gt;
   &amp;lt;/value&amp;gt;
  &amp;lt;/param&amp;gt;
  &amp;lt;param&amp;gt;
   &amp;lt;value&amp;gt;[removed]&amp;lt;/value&amp;gt;
  &amp;lt;/param&amp;gt;
 &amp;lt;/params&amp;gt;
&amp;lt;/methodCall&amp;gt;&amp;quot;,&amp;quot;&amp;quot;
WindowsLiveWriter,5612,None,00013,15-Jan-2010 22:51:52.250,&amp;quot;XML-RPC response:
http://sylvain2/BlogueWP1/xmlrpc.php
&amp;lt;?xml version=&amp;quot;&amp;quot;1.0&amp;quot;&amp;quot;?&amp;gt;
&amp;lt;methodResponse&amp;gt;
  &amp;lt;fault&amp;gt;
    &amp;lt;value&amp;gt;
      &amp;lt;struct&amp;gt;
        &amp;lt;member&amp;gt;
          &amp;lt;name&amp;gt;faultCode&amp;lt;/name&amp;gt;
          &amp;lt;value&amp;gt;&amp;lt;int&amp;gt;405&amp;lt;/int&amp;gt;&amp;lt;/value&amp;gt;
        &amp;lt;/member&amp;gt;
        &amp;lt;member&amp;gt;
          &amp;lt;name&amp;gt;faultString&amp;lt;/name&amp;gt;
          &amp;lt;value&amp;gt;&amp;lt;string&amp;gt;Les services XML-RPC sont désactivés sur ce blog. Un administrateur peut les activer à /BlogueWP1/wp-admin/options-writing.php&amp;lt;/string&amp;gt;&amp;lt;/value&amp;gt;
        &amp;lt;/member&amp;gt;
      &amp;lt;/struct&amp;gt;
    &amp;lt;/value&amp;gt;
  &amp;lt;/fault&amp;gt;
&amp;lt;/methodResponse&amp;gt;
&amp;quot;,&amp;quot;&amp;quot;
WindowsLiveWriter,5612,None,00014,15-Jan-2010 22:53:01.437,&amp;quot;499 499&amp;quot;,&amp;quot;&amp;quot;
&lt;/textarea&gt;&lt;/pre&gt;
&lt;/form&gt;

&lt;p&gt;Note the presence of two XML documents in this file; as shown by the two lines beginning with &lt;strong&gt;&lt;font color="#ff0000"&gt;&amp;lt;?xml ...&amp;gt;&lt;/font&gt;&lt;/strong&gt; and followed by a serie of paremeters delimited by &amp;lt;...&amp;gt;.&amp;#160; Each of these tags has a matching end tag delimited by &amp;lt;/...&amp;gt;; for example, we have the pair &amp;lt;value&amp;gt; and &amp;lt;/value&amp;gt; and between these two tags, there is some piece of information; which can include other pairs of tags.&amp;#160; There is not matching end tag for the very first one, the &lt;font color="#ff0000"&gt;&lt;strong&gt;&amp;lt;?xml ...&amp;gt;&lt;/strong&gt;&lt;/font&gt; tag.&amp;#160; Instead, the end of the very first thing to follow it, the root tag, which is &lt;strong&gt;&amp;lt;methodCall&amp;gt;&lt;/strong&gt; in the example above, is used to indicate the end of the corresponding XML document.&lt;/p&gt;

&lt;p&gt;The first XML document describes the connection request that has been sent to the server as somewhat indicated by the name of the root tag: &lt;strong&gt;&amp;lt;methodCall&amp;gt;&lt;/strong&gt; (in yellow below).&amp;#160; After that, we have another tag &lt;strong&gt;&amp;lt;methodName&amp;gt;&lt;/strong&gt; which gives us the name of the method that have been called on the server: &lt;strong&gt;&lt;font color="#ff0000"&gt;blogger.getUsersBlogs&lt;/font&gt;&lt;/strong&gt;.&amp;#160; The other tags that follow are simply the parameters to be used for this method.&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: hidden; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p&gt;&amp;lt;?xml version=&amp;quot;&amp;quot;1.0&amp;quot;&amp;quot; encoding=&amp;quot;&amp;quot;utf-8&amp;quot;&amp;quot;?&amp;gt; 
    &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;methodCall&amp;gt;&lt;/span&gt; 

    &lt;br /&gt;&amp;lt;methodName&amp;gt;&lt;font color="#ff0000"&gt;blogger.getUsersBlogs&lt;/font&gt;&amp;lt;/methodName&amp;gt; 

    &lt;br /&gt;&amp;#160; &amp;lt;params&amp;gt; &lt;/p&gt;

  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ... 
    &lt;br /&gt;&amp;#160; &amp;lt;/params&amp;gt; 

    &lt;br /&gt;&amp;lt;/methodCall&amp;gt;&amp;quot;,&amp;quot;&amp;quot;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;There is nothing really interesting in this first XML document because it has been build by WLW to be sent to the server and doesn't contains any error in it.&amp;#160; However and much more interesting is the second XML document that contains the server response as indicated by the name &lt;strong&gt;methodResponse&lt;/strong&gt; of its root tag and which contains in this case an item called &lt;strong&gt;&lt;font color="#ff0080"&gt;&amp;lt;fault&amp;gt;&lt;strong&gt;&lt;font color="#ff0080"&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/strong&gt; (in pink below).&amp;#160; Clearly, this is indication from the server that something got wrong on its side.&amp;#160; After that, you can recognise the text of the error message that has been displayed by WLW and which was telling us about the configuration error in the options of WordPress (in red below):&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p&gt;&amp;lt;?xml version=&amp;quot;&amp;quot;1.0&amp;quot;&amp;quot;?&amp;gt; 
    &lt;br /&gt;&amp;lt;methodResponse&amp;gt; 

    &lt;br /&gt;&amp;#160; &lt;font color="#ff0080"&gt;&lt;strong&gt;&amp;lt;fault&amp;gt;&lt;/strong&gt;&lt;/font&gt; &lt;/p&gt;

  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ... 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;value&amp;gt;&amp;lt;string&amp;gt;&lt;span style="color: red"&gt;Les services XML-RPC sont désactivés sur ce blog. Un administrateur peut les activer à /BlogueWP1/wp-admin/options-writing.php&lt;/span&gt;&amp;lt;/string&amp;gt;&amp;lt;/value&amp;gt; &lt;/p&gt;

  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ... 
    &lt;br /&gt;&amp;#160; &amp;lt;/fault&amp;gt; 

    &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;/methodResponse&amp;gt;&lt;/span&gt; 

    &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;quot;,&amp;quot;&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;In this example, it is important to pay a very special attention to the end of the XML document and specifically, to the termination tag &amp;quot;&lt;strong&gt;&amp;lt;/methodReponse&amp;gt;&lt;/strong&gt;&amp;quot; that I have highlighted in yellow. This ending tag might look unsignificant but we will soon see that often, it will contains the key in solving many communication problems of WLW.&lt;/p&gt;

&lt;p&gt;For the following example, I have reproduced on my system a problem that I've had to deal with recently and seems to be quite prevalent amongst people using WordPress but that will also happen - albeit less frequently - to other bloggins system using PHP.&amp;#160; In this particular case, the file wp-config.php has been corrupted in a very specific manner that I will describe later but many other files in WordPress or from another blogging system could be corrupted in the same way and would give the same erroneous result.&amp;#160; The interesting part of this example is that it will precisely result in an aborted communication and WLW will then show us its infamous error message: &lt;em&gt;&amp;quot;An error occurred while attempting to connect to your blog: Invalid Server Response -- The response to the blogger.getUsersBlogs method received from the web-server log was invalid.&lt;/em&gt; &lt;em&gt;You must correct this error before proceeding&lt;/em&gt;&lt;em&gt;&amp;quot;&lt;em&gt;&lt;/em&gt;&lt;/em&gt;.&amp;#160; This example is then a perfect&lt;em&gt;&lt;em&gt;&lt;/em&gt;&lt;/em&gt; demonstration to show what's written in the log file when such an error occurs and how to interpret this information to solve our problem.&lt;/p&gt;

&lt;p&gt;As we saw earlier, there is a setting for blocking the use of XML-RPC on WordPress and any attempt to use it will result in an error message sent back by WordPress; error message which is then displayed to us by WLW.&amp;#160; However, if I attempt to repeat this test but now, with the corrupted script file in place, instead of getting this explicit error message I will get the generic error message (the one without any information).&lt;/p&gt;

&lt;p&gt;If we take a look at the log file, we can see that the error message about the incorrect configuration has been indeed sent back by WP but now, there is something fishy about this entry: that last characters of the termination tag have now gone missing! :&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p&gt;&amp;lt;?xml version=&amp;quot;&amp;quot;1.0&amp;quot;&amp;quot;?&amp;gt; 
    &lt;br /&gt;&amp;lt;methodResponse&amp;gt;&lt;/p&gt;

  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ... 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;value&amp;gt;&amp;lt;string&amp;gt;Les services XML-RPC sont désactivés sur ce blog. Un administrateur peut les activer à /BlogueWP1/wp-admin/options-writing.php&amp;lt;/string&amp;gt;&amp;lt;/value&amp;gt;&lt;/p&gt;

  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ...&lt;/p&gt;

  &lt;p&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;/methodRespons&lt;/span&gt;&lt;span style="background-color: yellow"&gt;&amp;quot;,&amp;quot;&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Compare this tag « &amp;lt;/methodRespons&amp;quot;, &amp;quot;&amp;quot; » with the previous one: « &amp;lt;/methodReponse&amp;gt; ».&amp;#160; In fact, even the end of the line characters have vanished because the comma and the two double-quotes were part of the following line.&lt;/p&gt;

&lt;p&gt;Immediately after this truncated XML document, we can see that WLW has now wrote an entry to the effect that the received response from the server was invalid and this is this last entry that it has shown us:&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p&gt;WindowsLiveWriter,5612,Fail,00031,16-Jan-2010 04:27:02.953,&amp;quot;WindowsLive.Writer.Extensibility.BlogClient.BlogClientInvalidServerResponseException: Invalid Server Response - The response to the blogger.getUsersBlogs method received from the blog server was invalid:&lt;/p&gt;

  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ...&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;If we still keep the corrupted script file but now retrying to connect but only after activating the protocol XML-RPC on the WordPress server, we will now see a full response back from WordPress but still, with its ending tag truncated:&amp;#160; &lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p&gt;&amp;lt;?xml version=&amp;quot;&amp;quot;1.0&amp;quot;&amp;quot;?&amp;gt; 
    &lt;br /&gt;&amp;lt;methodResponse&amp;gt; 

    &lt;br /&gt;&amp;#160; &amp;lt;params&amp;gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;param&amp;gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;value&amp;gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;array&amp;gt;&amp;lt;data&amp;gt; 

    &lt;br /&gt;&amp;#160; &amp;lt;value&amp;gt;&amp;lt;struct&amp;gt; 

    &lt;br /&gt;&amp;#160; &amp;lt;member&amp;gt;&amp;lt;name&amp;gt;isAdmin&amp;lt;/name&amp;gt;&amp;lt;value&amp;gt;&amp;lt;boolean&amp;gt;1&amp;lt;/boolean&amp;gt;&amp;lt;/value&amp;gt;&amp;lt;/member&amp;gt; 

    &lt;br /&gt;&amp;#160; &amp;lt;member&amp;gt;&amp;lt;name&amp;gt;url&amp;lt;/name&amp;gt;&amp;lt;value&amp;gt;&amp;lt;string&amp;gt;/BlogueWP1/&amp;lt;/string&amp;gt;&amp;lt;/value&amp;gt;&amp;lt;/member&amp;gt; 

    &lt;br /&gt;&amp;#160; &amp;lt;member&amp;gt;&amp;lt;name&amp;gt;blogid&amp;lt;/name&amp;gt;&amp;lt;value&amp;gt;&amp;lt;string&amp;gt;1&amp;lt;/string&amp;gt;&amp;lt;/value&amp;gt;&amp;lt;/member&amp;gt; 

    &lt;br /&gt;&amp;#160; &amp;lt;member&amp;gt;&amp;lt;name&amp;gt;blogName&amp;lt;/name&amp;gt;&amp;lt;value&amp;gt;&amp;lt;string&amp;gt;Le p&amp;amp;amp;#039;tit blogue à Sylvain&amp;lt;/string&amp;gt;&amp;lt;/value&amp;gt;&amp;lt;/member&amp;gt; 

    &lt;br /&gt;&amp;#160; &amp;lt;member&amp;gt;&amp;lt;name&amp;gt;xmlrpc&amp;lt;/name&amp;gt;&amp;lt;value&amp;gt;&amp;lt;string&amp;gt;/BlogueWP1/xmlrpc.php&amp;lt;/string&amp;gt;&amp;lt;/value&amp;gt;&amp;lt;/member&amp;gt; 

    &lt;br /&gt;&amp;lt;/struct&amp;gt;&amp;lt;/value&amp;gt; 

    &lt;br /&gt;&amp;lt;/data&amp;gt;&amp;lt;/array&amp;gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/value&amp;gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/param&amp;gt; 

    &lt;br /&gt;&amp;#160; &amp;lt;/params&amp;gt;&lt;/p&gt;

  &lt;p&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;/methodRespons&lt;/span&gt;&lt;span style="background-color: yellow"&gt;&amp;quot;,&amp;quot;&amp;quot; 
      &lt;br /&gt;

      &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;And surely enough, because of this truncated ending tag, WLW keep telling us that the received response from the XML-RPC server was invalid and will abort the rest of the process. So even if a this stage the XML-RPC publishing protocol has now been correctly set up on the WordPress server, the problem caused by the corrupted file will still be blocking us from using WLW against this server.&lt;/p&gt;

&lt;p&gt;Of course, the next step is to identify what is this corruption that has been introduced into the script file and for this, we will use another tool: Fiddler; which is a free tool used to capture and analyze the raw HTML traffic that passes between a client and a web server.&amp;#160; Of couser, you could also use any other tool available for capturing and analyzing this HTML traffic HTML but Fiddler is free, simple to use and more then enough powerful to give us the solution that we are looking for.&amp;#160; Also, the following discussion about Fiddler might look complicated at first but you'll see at the end that it's relatively easy to get the information that we need to solve our little communication problem.&lt;/p&gt;

&lt;h3&gt;4- Fiddler&lt;/h3&gt;

&lt;p&gt;You can get Fiddler on the following website: &amp;quot;&lt;a href="http://www.fiddler2.com/fiddler2/"&gt;Fiddler Web Debugger - A free web debugging tool&lt;/a&gt;&amp;quot;.&amp;#160; Once installed, you click &lt;strong&gt;Fiddler2&lt;/strong&gt; in your Windows menu to launch the program (click on the image to see a larger version) :&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_w76XuJflOGw/S3pl6zofNRI/AAAAAAAAFqk/GR9os19P_Gw/s1600-h/image42.png" target="_blank"&gt;&lt;img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="391" alt="image" src="http://lh5.ggpht.com/_w76XuJflOGw/S3pl8f690mI/AAAAAAAAFqo/jGvvnvZcIvU/image_thumb20.png?imgmax=800" width="550" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Again, even if the above figure might look complicated, you'll see that's relatively easy to get the information that we want and you don't have to worry about most of these parameters but I prefer to explain too much than not enough.&lt;/p&gt;

&lt;p&gt;At the left of the previous figure, we can see a list of TCP/IP sessions, each session consisting of a request sent to the server (which may be any kind of TCP/IP server: a web server or a XML Server for example) and a response sent back by the server. This is always the case with most TCP/IP communications: for each request sent, there is a single response sent back and the pair of two forms a session.&amp;#160; In our case, these sessions are also of the type HTTP as we can see on the figure with the light blue arrow #3.&amp;#160; The XML-RPC protocol used by WLW to communicate with a blog use standard HTTP sessions over TCP/IP in exactly the same way as your browser (Internet Explorer, Firefox) communicate with a web server. This which means that you shouldn't have any firewall or proxy issue using this protocol if you can access your blog using&amp;#160; any browser.&amp;#160; At the left of each session, Fiddler will also put an icon describing its type and status.&amp;#160; You can get a list of all these icons with their meanings at the following page: &amp;quot;&lt;a href="http://www.fiddler2.com/Fiddler/help/ui.asp"&gt;Fiddler Web Debugger - User Interface&lt;/a&gt;&amp;quot;.&lt;/p&gt;

&lt;p&gt;At the right, we can see the details of each of these sessions if we select the &lt;strong&gt;Inspectors&lt;/strong&gt; tab (#1 - orange circle).&amp;#160; At the top is displayed the details of the request and below it the details of the response.&amp;#160; We can also choose between a variety of formats for displayed those details: &lt;strong&gt;Headers, TextView,&lt;/strong&gt;&amp;#160;&lt;strong&gt;RAW HexView&lt;/strong&gt;, etc.; as indicated by the red arrows (#2).&amp;#160; Note that you can choose a different display format for the request and the response.&lt;/p&gt;

&lt;p&gt;With the HTTP protocol, each request and each response are constitued of a single file (more exactly, a file for the request and a second file for the response) that contains two parts separated by a single blank line (arrows #6 and #7): the &lt;strong&gt;header&lt;/strong&gt; and the &lt;strong&gt;text.&lt;/strong&gt;&amp;#160; So we have a header and text for the request and another header and text for the response; each of these two pairs separated by exactly a blank line in their respective file.&amp;#160; If you click on either the &lt;strong&gt;Header&lt;/strong&gt; or the &lt;strong&gt;TextView&lt;/strong&gt; tab, only the header or the text will be shown - each of them with a special formating - but we can also choose the &lt;strong&gt;RAW&lt;/strong&gt; format for displaying both of them but this time, without any special formating.&amp;#160; This is the format that has been chosen for both the request and the response windows in the previous figure.&lt;/p&gt;

&lt;p&gt;Finally, the &lt;strong&gt;HexView&lt;/strong&gt; format will also show us both the header and the text - likes the RAW format - but will also add the hexadecimal value of each character into a second column that enable us to accurately determine the exact identification of each character, including the various *blank* and control character that might be present. Later, in the section 5, we will see an example if this hexadecimal format that will show us the identication of some strange characters coming from the corrupted file.&lt;/p&gt;

&lt;p&gt;If we take a closer look at the header for the request shown in the previous figure, we can see that it contains first a &lt;strong&gt;POST&lt;/strong&gt; parameter (#8, blue arrow) with the URL of the script file that the XML-RPC request was sent to (&lt;a href="http://sylvain2/BlogueWP1/xmlrpc.php&amp;quot;"&gt;h&lt;/a&gt;&lt;a href="http://sylvain2/BlogueWP1/xmlrpc.php"&gt;ttp://sylvain2/BlogueWP1/xmlrpc.php&lt;/a&gt;&amp;quot;&lt;/a&gt; in this case).&amp;#160; After a few other parameters, we find toward the end of the header this very important parameter that is the &lt;strong&gt;Content-Length&lt;/strong&gt;.&amp;#160; By the way, notice that the exact order of parameters in the header is without any signification and is not garantee to remains the same.&amp;#160; After that, we see one last parameter (&amp;quot;Connection: Close&amp;quot;) and finally, the blank line that is used as a separator between the header and the text that follows.&amp;#160; In the case of XML-RPC, this text is a XML document that contains the information that we are sending to the server but with other requests, we could also see an ordinary HTML POST document.&lt;/p&gt;

&lt;p&gt;If we now take a look at the detail of the Response that has been sent back by the XML-RPC server (bottom right window); we can see that it follows a similar format: an header followed by a blank line and a XML document as the text at the end.&amp;#160; In the header, there is no POST parameter because this is a response but there's still a Content-Length parameter (#10, pink arrow) which contains the length of the text.&amp;#160; Well, we should say that this Content-Length *should* contains the length of the following text.&amp;#160; However, we will see later that with PHP, this is not always the case and that this little problem with the Content-Length parameter is indeed the source of many of our communication problems with WLW and that will also explains the truncated ending tag that we have saw earlier in the log file.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;-- The rest of this section is for explaining some basic configuration options of Fiddler but if you want to, you can skip this reading and jump directly to the next section &amp;quot;5- Issue #1 - Appearance of the UTF-8 BOM&amp;quot; to see what happens with the Content-Length parameter. --&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When we use Fiddler, the first setting to check is the &lt;strong&gt;Capturing&lt;/strong&gt; mode.&amp;#160; It's function is very simple: when the Capture mode is off, nothing is captured by Fiddler and we can see its value displayed at the bottom left of the Fiddler's window on the status bar: #4, green arrow.&amp;#160; We switch between these two modes (ON and OFF) by either clicking displayed on the displayed value (note: only a white space is displayed when the mode is OFF but you can still click on it) or by pressing the function key &lt;strong&gt;F12&lt;/strong&gt; on the keyboard or by using the option &amp;quot;&lt;strong&gt;Capture Traffic: F12&lt;/strong&gt;&amp;quot; under the &lt;strong&gt;File&lt;/strong&gt; menu.&lt;/p&gt;

&lt;p&gt;Even when the capturing mode is ON, Fiddler doesn't necessarily capture everything and there are many settings where you can adjust what will be captured and one of these settings is the second text icon directly at the right of the Capture mode text icon on the status bar, as indicated on the figure by the yellow arrow #5.&amp;#160; This setting can be set to either &amp;quot;&lt;strong&gt;All Processes&lt;/strong&gt;&amp;quot;, &amp;quot;&lt;strong&gt;Web Browsers&lt;/strong&gt;&amp;quot;, &amp;quot;&lt;strong&gt;Non-Browser&lt;/strong&gt;&amp;quot; and &amp;quot;&lt;strong&gt;Hide-All&lt;/strong&gt;&amp;quot; and you can change this value simply by clicking on the text icon.&amp;#160; In our case with WLW, this setting must be set to either &amp;quot;&lt;strong&gt;All Processes&lt;/strong&gt;&amp;quot; or &amp;quot;&lt;strong&gt;Non-Browser&lt;/strong&gt;&amp;quot;; otherwise, we won't be capturing the information that we need.&lt;/p&gt;

&lt;p&gt;When Fiddler starts capturing, it is not uncommon to quickly get dozens or even hundreds of captured sessions so we must have a way to clarify this a bit and evidently, the first thing we can do is to delete all the older sessions captured from previous run.&amp;#160; This can be done with the menu &lt;strong&gt;Edit | Remove | All Sessions.&lt;/strong&gt;&amp;#160; Besides that, Fiddler is offering us many filtering options that are found under the tab &lt;strong&gt;Filters &lt;/strong&gt;which is shown in the following figure (orange circle, #1) :&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_w76XuJflOGw/S3pl9fSRIjI/AAAAAAAAFqs/5dmPAjun2-I/s1600-h/image482.png" target="_blank"&gt;&lt;img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="339" alt="image" src="http://lh6.ggpht.com/_w76XuJflOGw/S3pl-SOiItI/AAAAAAAAFqw/x6J7JL5i8y8/image48_thumb1.png?imgmax=800" width="550" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Before using many of these filtering options, we must first activate them by checking ON the &amp;quot;Use Filters&amp;quot; checkbox in the upper left (#2).&amp;#160; Note that the &lt;strong&gt;Filters&lt;/strong&gt; tab will visually indicates to us when these filters are active by displaying a check mark directly on the tab itself (orange circle, #1).&lt;/p&gt;

&lt;p&gt;The first available option is the &amp;quot;&lt;strong&gt;Keep only the most recent [200] sessions&lt;/strong&gt;&amp;quot; (#7) that will automatically delete the older sessions above a certain number.&amp;#160; You can adjust this value but it's set to 200 by default.&amp;#160; Below that, there are the filtering options that apply to the servers - or &amp;quot;Hosts&amp;quot; in Fiddler terminology - for which capturing will be turned ON of OFF.&amp;#160; There, we can choose to restrict the capture to the requests sent to any server (or &amp;quot;&lt;strong&gt;Hosts&lt;/strong&gt;&amp;quot;) or to a server either located on the local LAN (intranet) or on the Internet (Wide Areal Network (WAN)) by selecting &amp;quot;&lt;strong&gt;Show only Intranet Hosts&lt;/strong&gt;&amp;quot; or &amp;quot;&lt;strong&gt;Show only Internet Hosts&lt;/strong&gt;&amp;quot; on the combobox #3.&lt;/p&gt;

&lt;p&gt;We can even be more specific than and directly name the desired servers or Hosts by selecting the option &amp;quot;&lt;strong&gt;Show only the following Hosts&lt;/strong&gt;&amp;quot; on the next comobox and then indicating their names on the text box that follows right below, see #4. Here, I've set up the local server &amp;quot;&lt;strong&gt;sylvain2&lt;/strong&gt;&amp;quot; as the specific host for which the capturing must be made.&amp;#160; You can name more than one server if you want to.&lt;/p&gt;

&lt;p&gt;Instead of filtering based on the servers (or &amp;quot;hosts&amp;quot;), you can also choose to filter based on one of the processes running on your machine and the &amp;quot;&lt;strong&gt;Client Process&lt;/strong&gt;&amp;quot; is just for that.&amp;#160; We must first check the box &amp;quot;&lt;strong&gt;Show only traffic from&lt;/strong&gt;&amp;quot; (#6) and then select on the dropdown menu at the right the desired process.&amp;#160; Here, I have chosen the process &amp;quot;&lt;strong&gt;WindowsLiveWriter: 3884 - Solutionner problème connection WLW&lt;/strong&gt;&amp;quot; so that Fiddler will capture only the TCP/IP traffic initiated by Windows Live Writer.&amp;#160; The process number (here 3884) and the shown title (&amp;quot;Solutionner problème connection WLW&amp;quot; here (in french)) will of course be different in your case.&amp;#160; Beware: WLW always uses a single process for managing all of your windows; so even if you have multiple WLW windows opened, this selection will only show you one at a time, usually the one that's currently active.&amp;#160; However, this choice will always be good for every opened WLW windows; regardless of the current active window.&lt;/p&gt;

&lt;p&gt;Of course, you don't really need to select all of these options of even anyone of them.&amp;#160; Also, be aware that some of these filtering options can also affect other things than just what will be captured or not by Fiddler and that with these, you can&amp;#160; or could also block or change the transmission of any requests or responses related to any kind of TCP/IP activity.&amp;#160; For example, if you check the &amp;quot;&lt;strong&gt;Block images files&lt;/strong&gt;&amp;quot; option in the &amp;quot;&lt;strong&gt;Response Type and Size&lt;/strong&gt;&amp;quot; section, the transmission of all the images files will be blocked not only for WLW but for the other processes as well; even including your current browser.&amp;#160; In effect, this means that the web pagew will now be shown without any image displayed on it, as you can see from the second figure below.&amp;#160; Therefore, you must be careful when using a program like Fiddler and you must check all the options carefully when something is not going or loking right.&lt;/p&gt;

&lt;p&gt;&lt;img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="118" alt="image" src="http://lh5.ggpht.com/_w76XuJflOGw/S3pl--lzJPI/AAAAAAAAFq0/7FT47I5wpJM/image22.png?imgmax=800" width="550" border="0" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="248" alt="image" src="http://lh4.ggpht.com/_w76XuJflOGw/S3pl_7fC51I/AAAAAAAAFq4/pPHE3U3RYjQ/image971.png?imgmax=800" width="546" border="0" /&gt; &lt;/p&gt;

&lt;h3&gt;5- Issue # 1 - Appearance of the UTF-8 BOM&lt;/h3&gt;

&lt;p&gt;Now that we know Fiddler, we can use it to solve our little problem: if we try again to communicate with WordPress using Windows Live Writer (WLW) but this time using Fiddler to watch the processus, we are quickly greeted by the following error message from Fiddler:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_w76XuJflOGw/S3pmAYDZ6_I/AAAAAAAAFq8/NuEn8us-DKo/s1600-h/image41.png" target="_blank"&gt;&lt;img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="187" alt="image" src="http://lh6.ggpht.com/_w76XuJflOGw/S3pmA6h8KfI/AAAAAAAAFrA/11BA62gCCNk/image_thumb17.png?imgmax=800" width="500" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&amp;quot;Fiddler has detected a protocol violation in session #633.&amp;#160; Content-Length mistmatch: Reponse Header claimed 634 bytes, but server sent 637 bytes.&amp;quot;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Immediately after that, WLW shows us its generic error message that we have already seen previously and abort the rest of the communication. So it's looks like that the problem from a not well formated response from the server: the length of the text as indicated in the header (the Content-Length parameter) is too short of 3 characters. This difference of 3 characters explains why the text of the response recorded by WLW in its log file has been truncated: WLW stopped reading the rest of the text after reaching the total numbers of characters as indicated in the header and simply dropped the rest. So WLW is giving full precedence to the Content-Length parameter instead of trying to follow the textual layout of the XML document has it has been written in the response file by the XML-RPC server.&lt;/p&gt;

&lt;p&gt;One way to correct that would then be to make a proper adjustement to this parameter in the PHP script where it is calculated.&amp;#160; For example, Peter Van Eeckhoutte suggests in his blog (&amp;quot;&lt;a href="http://www.corelan.be:8800/index.php/2008/10/14/windows-live-writer-unable-to-connect-to-wordpress-blog/#"&gt;Windows Live Writer unable to connect to Wordpress Blog | Peter Van Eeckhoutte's Blog&lt;/a&gt;&amp;quot;) to modify the WordPress file &lt;strong&gt;class-IXR.php&lt;/strong&gt; - which is the script that generates the XML response - located in the directory &amp;quot;wp-includes&amp;quot; by changing the following line located in the function &lt;strong&gt;output ($xml) :&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;$ length = strlen ($xml);&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;so that it will now automatically add 3 characters every time:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;$ length = strlen ($xml) +3;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It doesn't need much explanation to say that this correction is not very satisfactory not only because this is a &amp;quot;blind&amp;quot; correction but also because it doesn't tell us anything about why the calculated length is invalid in the first place and, of course, doesn't correct the problem at its source at all.&amp;#160; We don't know if this will always be the case or if the problem will get corrected at some point in time and furthermore, we don't know either what will happen is someone want to use another blog editiong software than WLW.&lt;/p&gt;

&lt;p&gt;So this is clearly not a very good solution but to find a better one, we must first know why there is this discrepancy in the first place and this exactly what we can find if we take a deeper look at the response using the Hexadecimal mode of Fiddler by chosing the &lt;strong&gt;HexView&lt;/strong&gt; tab (orange circle) : &lt;img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="301" alt="image" src="http://lh3.ggpht.com/_w76XuJflOGw/S3pmBk8C9FI/AAAAAAAAFrE/Sf8HFztILC0/image98.png?imgmax=800" width="550" border="0" /&gt; &lt;/p&gt;

&lt;p&gt;In this mode, the information is displayed on three columns: in the first, we can see the address of each line in hexadecimal; in the second column, the hexadecimal value of each character and finally in the third, the characters themselves; with the exception the control and other non-printable characters which are replaced by a point.&lt;/p&gt;

&lt;p&gt;If we look in the third column for the beginning of the XML document, that is, the five characters &lt;strong&gt;&lt;font color="#ff0000"&gt;&amp;lt;?xml&lt;/font&gt;&lt;/strong&gt;;&amp;#160; we can see that they are preceded right before them by three strange characters : &lt;strong&gt;&lt;font color="#ff0000"&gt;ï»¿&lt;/font&gt;&lt;/strong&gt; ; that I have highlighted in blue on the figure.&amp;#160; These three characters are the BOM (Byte Order Mark, see &amp;quot;&lt;a href="http://en.wikipedia.org/wiki/Byte_order_mark"&gt;Byte order mark - Wikipedia, the free encyclopedia&lt;/a&gt;&amp;quot;) for an UTF-8 (Unicode 8 bit) encoded file.&amp;#160; Usually, a BOM marker for an Unicode file will only be present at the beginning of it and not in the middle.&amp;#160; While this location in the middle is not really forbidden, the presence of a BOM at a location other then the beginning of the file has no signification and normally, a program should simply read past them when they are in the middle of a file.&lt;/p&gt;

&lt;p&gt;However, for Windows Live Writer (WLW), these three characters are not totally skipped away and while they are not used to determine the encoding of the file, as it should be because they are not at its beginning, they are still counted as part of the total number of characters indeicated in the Content-Length parameter.&amp;#160; However, a close observation of the PHP code reveals that when they are emitted, they are not be counted as part of the length of the text; which at the end gives us this truncated XML decument by three characters.&lt;/p&gt;

&lt;div style="display: none; background-color: #e0e0e0"&gt;
  &lt;p&gt;&lt;em&gt;&lt;strong&gt;(Note:&lt;/strong&gt; the sequence of 4 characters &lt;strong&gt;&amp;quot;0D-0A-0D-0A&amp;quot;&lt;/strong&gt; that you can see just before the BOM and the tag &amp;quot;xml&amp;quot; are the two newlines + carriage return needed to create the white line separating the header text that follows, the two characters 0x0D and 0x0A is the definition of a new line in Windows. On Macintosh and Unix, you'll find only the character 0x0D instead of two characters 0x0D and 0x0A. These four non-printable characters are shown by 4 points in the third column.)&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;It looks that we have found the cause of our truncated response: the presence of the BOM in mid-file offset the reading of the XML document by WLW by 3 characters and there is a serious problem here: if we don't adjust the Content-Length; WLW is thrown off by three characters.&amp;#160; However, we don't know for sure if this will always be the case and we don't know eithr what will happen if someone else will want to use another blog editing software than WLW.&amp;#160; Furthermore, this problem with the presence of the BOM is only one of the many other possible problems that can also affect the value of the Content-Length parameter. For example, on his blog (in italian), Etrusco says that he has found a difference of 10 characters between the length specified in Content-Length and the actual length of the XML document; see &amp;quot;&lt;a href="http://www.pensando.it/wp/index.php/wordpress/windows-live-writer-e-wordpress-quando-lxmlrpc-smette-di-funzionare"&gt;Windows Live Writer e wordpress, quando l’xmlrpc smette di funzionare! | pensando.it&lt;/a&gt;&amp;quot;.&lt;/p&gt;

&lt;p&gt;So our best solution here would be to get rid of the presence this BOM in the middle of the file and for this, we must know how and why is PHP writing this BOM in the first place and if there is any way of stopping it doing this.&amp;#160; This is the topic of the next section.&lt;/p&gt;

&lt;h3&gt;6- BOM (Byte Order Mark),&amp;#160; PHP and XVI32.EXE&lt;/h3&gt;

&lt;p&gt;The primary function of the BOM (Byte Order Mark) is to indicate the storage order of bytes for files that have been encoding using the 16 bit of Unicode (UTF-16); because, in the case of the 16 bit mode, two bytes are used for each character but depending of the operating system, either the high order byte or the low order by could be written first for each pair.&amp;#160; The writing of a BOM at the beginning of the file is then useful for specifying which one of these two orders has been used.&amp;#160; The case for the 8 bit mode of Unicode (UTF-8) is a little different because there is no byte order in this case and whatever the operating system, all files encoded with UTF-8 are always encoded in the same way.&amp;#160; However, writing a marker at the beginning of a file encoded with UTF-8 could still be useful to distinguish it from other encoding that are not UT-8 (weither it is one of the two UTF-16 or one of the various Ascii modes or anything else).&lt;/p&gt;

&lt;p&gt;Beside the ordering of the bytes, the big problem with UTF-16 is that for Latin alphabets, they take twice the size of files encoded with an Ascii character sets such as Windows-1252 but this is not a problem with UTF-8.&amp;#160; English files encoded in UTF-8 occupy the same size and for other latin alphabet such as french or spanish, the difference in size is barely bigger.&amp;#160; The advantage of size is not always there for other alphabets such as Thai but then, there is the problem is mixing multiple alphabets inside the same file; like a combination of english, french, spanish and Thai if someone want to do that.&amp;#160; This is not a problem with UTF-8, so in recent years, it has slowly but surely started to make its way of becoming the de-facto standard for the internet and for the storage of internationalized files.&lt;/p&gt;

&lt;p&gt;However, there is one small problem that remains and this is the question of writing or not a BOM for UTF-8 files and on this question, the of PHP 5 for UTF-8 is seriously lagging behind.&amp;#160; While many other languages offer the option of writing or not a BOM; the developers of PHP 5 have simply chosen to automatically write or not of a BOM based on its presence in any of the PHP script files involved.&amp;#160; So to be clear: you or the programmer doesn't decide to write a BOM or not but PHP will decide based on the fact that it will find at least one PHP script file with a BOM when it will execute a list of script files for a call.&amp;#160; So the presence of a single file with a BOM wins it all.&amp;#160; And to make things worst, there is not even a simple way of knowing or finding from inside a script is one will be written or not; so this is something that is totally out of our control.&lt;/p&gt;

&lt;p&gt;However, in our case, the solution is simple: if a BOM has been written then it's because one (or more) of the PHP script files has one and all we have to do is to find this culprit and strip away its BOM marker.&lt;/p&gt;

&lt;p&gt;There are many ways of finding this.&amp;#160; First, you could use a program such as EGREP to scan for every files and report those who have one or you can use an editor such as NotePad++ capable of showing - and deleting - a BOM at the beginning of a file and take a look at each file one by one.&amp;#160; Many of you probably have one favorite but for those who don't have one, I will suggest here a small program because of its simplicity of use: &lt;a href="http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm"&gt;XVI32, a free hexadecimal editor&lt;/a&gt; that you can download for free and that doesn't need to be installed on your system. Once downloaded, all you have to do is unzip it and then double-click on the executable &lt;strong&gt;&lt;tt&gt;XVI32.EXE&lt;/tt&gt;&lt;/strong&gt; file to launch the program. You can then use the menu to open the desired file or better yet, do a Drag &amp;amp; Drop of the desired file directly on the program's window:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_w76XuJflOGw/S3pmCGplMpI/AAAAAAAAFrI/ea-6BpvlGKw/s1600-h/image4.png" target="_blank"&gt;&lt;img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="280" alt="image" src="http://lh6.ggpht.com/_w76XuJflOGw/S3pmDUHiG8I/AAAAAAAAFrM/9oVhc1gzbok/image_thumb1.png?imgmax=800" width="500" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The only problem with this method is that you have to verify each file one by one until you find the culprit but in this case of Wordpress, there is one likely suspect and it's the configuration file &lt;strong&gt;wp-config.php.&lt;/strong&gt;&amp;#160; While the distributed version of this file doesn't have a BOM, this is our likely suspect because this is a file that we'll have to open in order to make change to the configuration of the WordPress installation and by doing so, we are putting ourself at the mercy of any editor that will think that it will be a good idea to add a BOM at the beginning of a file without even telling us (or by telling us while we don't understand the full implication of doing this).&amp;#160; This is the root of the problem: even if the distributed file doesn't have any BOM, there is a lot of ways that can make this happens or, as bad, removing it.&amp;#160; Therefore, it's a moving target and you must be careful, when you are editing this file or any other PHP script file, to not introduce inadvertantly a BOM at its beginning.&lt;/p&gt;

&lt;p&gt;If you want to remove the BOM using XVI32, simply use the Delete key over its three characters as they are shown above.&amp;#160; Note however that with other editors, the process for removing a BOM is not necessarily the same and that you might have to look at the options provided by the program.&amp;#160; Again, as some programs might add one - or strip it - automatically without telling you; so you must be careful and always check before using any editing program with a PHP script file.&lt;/p&gt;

&lt;h3&gt;7- Presence of extraneous characters in a PHP script file&lt;/h3&gt;

&lt;p&gt;As we have also say earlier, the presence a BOM is not the only thing that can throw away the determination of the exact value for the Content-Length parameter in a PHP script and two others would be the presence of extraneous characters - usually newlines and blank lines - at the beginning and the end of one or more PHP script files.&amp;#160; These extraneous characters are anything - including a blank space or a new line - that comes before the PHP starting tag &lt;strong&gt;&lt;font color="#ff0000"&gt;&amp;lt;?php&lt;/font&gt;&lt;/strong&gt; or the ending tag &lt;strong&gt;&lt;font color="#ff0000"&gt;?&amp;gt;&lt;/font&gt;&lt;/strong&gt; (albeit we have some very little lose for the end).&amp;#160; A PHP script used for a web page can normally have many of these starting and ending tags and also have a lot of other characters outside of these delimiters to be retranscribed verbatim on its output but the case for a script file used to build an XML-RPC response is different because these XML responses must follow a strict guideline and the presence of any illegal or extraneous character is forbidden; therefore those scripts must be constitued of a single pair of tags and have nothing else outside of them; not even a blank space or a newline at the beginning or at the end.&amp;#160; The only disgression is one single newline after the ending &lt;strong&gt;&lt;font color="#ff0000"&gt;?&amp;gt;&lt;/font&gt;&lt;/strong&gt; with maybe one or more blank space between the final &lt;strong&gt;&lt;font color="#ff0000"&gt;?&amp;gt;&lt;/font&gt;&lt;/strong&gt; and its single newline but nothing else after that; not even a second newline or a blank line.&lt;/p&gt;

&lt;p&gt;Unless by taking some very convoluted look at the output buffer, a PHP script cannot know if there is anything else outside of these two delimiters so it cannot takes these into account when calculating the length the XML document to be put in the Content-Length parameter and therefore, if there is indeed some extraneous characters in any of the script files, this parameter will be invalid and WLW will be unable to correctly read the XML response and will throw an error message.&amp;#160; If this is the case, we cannot directly determine which script is badly written by looking at the response or in the log file; however, we can at least determine if we are in front of a problem caused by extraneous characters instead of something else such as the presence of a BOM or a error or a warning message from the script itself; thus greatly restricting the field of search for solving the communication problem.&amp;#160; In the next two sections, we will see how to look in the Response for the presence of extraneous characters at either the beginning or the end of a script file.&lt;/p&gt;

&lt;h3&gt;8- Presence of extraneous characters at the beginning of a PHP script&lt;/h3&gt;

&lt;p&gt;We already know that when the Response is correctly formatted, one blank line (#5 and 6) separate the header from the XML response (#3 and 4); as we can see in the below figure illustrating a capture from Fiddler using the RAW mode.&amp;#160; Remember that the top window at the right is the Request and the bottom window if the Response and that we are mainly interested only in the Response in these cases.&amp;#160; (With most XML-RPC communication problems with WLW against a PHP server, there is no problem with the Request, only with the Response.)&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_w76XuJflOGw/S3pmEeoAu0I/AAAAAAAAFrQ/ysolR-e6iIM/s1600-h/image56.png" target="_blank"&gt;&lt;img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="339" alt="image" src="http://lh3.ggpht.com/_w76XuJflOGw/S3pmFqIaUBI/AAAAAAAAFrU/rruqC8GKu-c/image_thumb34.png?imgmax=800" width="550" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we take a look in the log file of WLW for the same correctly formated Response, we don't see the header or the blank line - because normally WLW doesn't record them - but we can see a proper and well written XML document; with no blank line before and no truncation of its ending tag &lt;strong&gt;&amp;lt;/methodResponse&amp;gt;&lt;/strong&gt; at the end:&lt;/p&gt;

&lt;p&gt;&lt;img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="351" alt="image" src="http://lh6.ggpht.com/_w76XuJflOGw/S4BqA3y2fFI/AAAAAAAAFsM/o2kDvwMYNLg/image411%5B1%5D.png?imgmax=800" width="500" border="0" /&gt;&lt;/p&gt;

&lt;p&gt;Now, let's take a look at what happens if we add a single extraneous blank line (#1) at the beginning of one of the PHP script, for example &lt;strong&gt;wp-config.php&lt;/strong&gt;, just before the starting tag &lt;strong&gt;&lt;font color="#ff0000"&gt;&amp;lt;?php&lt;/font&gt;&lt;/strong&gt; &lt;strong&gt;:&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="221" alt="image" src="http://lh4.ggpht.com/_w76XuJflOGw/S3pmHipXHyI/AAAAAAAAFrc/9QgOGzQ5Buo/image70.png?imgmax=800" width="500" border="0" /&gt;&lt;/p&gt;

&lt;p&gt;As expected, we will now receive an error message from WLW to the effect that the received XML-RPC response from the server is invalid and the capture from Fiddler will now show a second blank line separating the header from the XML text in the case of the Response (#2, bottom window) :&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_w76XuJflOGw/S3pmIi-VgHI/AAAAAAAAFrg/pJ1Tuh3UfBk/s1600-h/image55.png" target="_blank"&gt;&lt;img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="339" alt="image" src="http://lh4.ggpht.com/_w76XuJflOGw/S3pmKW8QzRI/AAAAAAAAFrk/7eYNI0BDjbY/image_thumb33.png?imgmax=800" width="550" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Furthermore, a look at the entry in the log file will now show a blank line before the XML document (#1, there was none in the case of a correctly formated Response) and the presence of a truncated ending tag (#2) : &lt;/p&gt;

&lt;p&gt;&lt;img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="417" alt="image" src="http://lh4.ggpht.com/_w76XuJflOGw/S3pmLd7oeCI/AAAAAAAAFro/9_Wr3KXS2l4/image79.png?imgmax=800" width="500" border="0" /&gt; &lt;/p&gt;

&lt;p&gt;Of course, if there are other extraneous characters such as additional blank lines or anything else, we will see all of these in both the capture from Fiddler in the log file.&amp;#160; For anything more than a single extraneous blank line, Fiddler will also start telling us about a difference between the Content-Length parameter and the real length of the text. (But it won't say anything when there is only a single extraneous blank line because there is some lose for the eventual presence of an ending newline at the very end of the file.)&lt;/p&gt;

&lt;p&gt;The problem here is that we don't know which file(s) on the server side has this or these extraneous characters; so we will have to look at them one by one.&amp;#160; The best way of doing this would be to switch to a standard template and deactivate all the plugins.&amp;#160; If the problem doesn't disappears, we can say that it is located in one of the file that is part of the standard distribution of blogging system; probably &lt;strong&gt;wp-config.php&lt;/strong&gt; in the case of Wordpress.&amp;#160; If it disappears, then we can say it's either in the installed template or in one of the plugins.&amp;#160; Most likely, this will be the second case; ie, one of the plugins; so you can start re-activating them one by one until your find the culprit.&lt;/p&gt;

&lt;h3&gt;9- Presence of extraneous characters at the end of a PHP script file&lt;/h3&gt;

&lt;p&gt;Beside being possibly at the beginning of a script file, extraneous characters can also be present at the end of the file; after the final &lt;strong&gt;&lt;font color="#ff0000"&gt;?&amp;gt;&lt;/font&gt;&lt;/strong&gt; ending tag.&amp;#160; However, there is a little twist here: it's not because that they are at the end of the script file that you will find them at the end of the Reponse, after the XML document.&amp;#160; When PHP execute the main script file (&lt;strong&gt;xmlrpc.php&lt;/strong&gt; in the case of WordPress) for executing a XML-RPC call, this script file will usually include one or more other script files near its beginning in order to get access to some additional PHP functionality and often, many of these included files will also include themselves other additional files.&lt;/p&gt;

&lt;p&gt;However, while these additional functions might be called later (or never) during the execution of the script; this is not the same for the presence of any extraneous characters: their printing will not be delayed later but instead will be done as soon as the containing file is including; which means usually before the execution of the main call in the main script file.&amp;#160; Therefore, the presence of any extraneous characters at the end of an included file will appears &lt;u&gt;&lt;strong&gt;before&lt;/strong&gt;&lt;/u&gt; the writing of the XML document response; ie, will appear at the same place as for the presence of extraneous characters at the beginning of a script file.&lt;/p&gt;

&lt;p&gt;For example, I have put one more blank line ad the end of the file wp-config.php; as you can see from the following figure: &lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_w76XuJflOGw/S3pmL7C2lyI/AAAAAAAAFrs/0Yr_rA13Xg0/s1600-h/image93.png" target="_blank"&gt;&lt;img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="273" alt="image" src="http://lh3.ggpht.com/_w76XuJflOGw/S3pmM_l5pWI/AAAAAAAAFrw/ZwzB9usuHu0/image_thumb55.png?imgmax=800" width="500" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I had to select the fnals character so that you can it.&amp;#160; As expected, after this change, the XML-RPC communication between WLW and WordPress doesn't work anymore and the capture of the Response by Fiddler or the WLW's log file will now show us an extraneous white line before the XML document and a truncated ending tag; just like it was in the case with an extraneous blank line at the beginning of the script file:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_w76XuJflOGw/S3pmNsa_WqI/AAAAAAAAFr0/YrWSjLIn958/s1600-h/image941.png" target="_blank"&gt;&lt;img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="417" alt="image" src="http://lh4.ggpht.com/_w76XuJflOGw/S3pmOskH4yI/AAAAAAAAFr4/yU5DV8EAxf8/image94_thumb.png?imgmax=800" width="500" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, if it's difficult or impossible to distinguish between extraneous characters at either the beginning or the end of a script file, what is our best solution?&amp;#160; Well, there is no magic solution here and like it was the case for extraneous characters at the beginning, the first step is to identify the culprit by checking all the main files - always think first about the configuration wp-config.php in the case of WordPress - and if you don't find it, by deactivating all plugins and all installed templates and going through them one by one and carefully checking their end.&lt;/p&gt;

&lt;p&gt;However, in this case, PHP has a nice little feature that can greatly facilitate our task of carefully checking the end of each file and it is that the ending tag &lt;strong&gt;&lt;font color="#ff0000"&gt;?&amp;gt;&lt;/font&gt;&lt;/strong&gt; at the end of a PHP script file is now optional since some of the last versions.&amp;#160; This means that instead of carefully checking their ends; we can simply delete the ending tag &lt;strong&gt;&lt;font color="#ff0000"&gt;?&amp;gt;&lt;/font&gt;&lt;/strong&gt; and after that, the scripting part will automatically extend to the very end of the file; without anymore the possibility of any extraneous characters at its end:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_w76XuJflOGw/S3pmRCRMLpI/AAAAAAAAFsE/jAUW-25OaiQ/s1600-h/image114.png" target="_blank"&gt;&lt;img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="273" alt="image" src="http://lh5.ggpht.com/_w76XuJflOGw/S3pmSZdNFyI/AAAAAAAAFsI/n9l4NePNHcY/image_thumb70.png?imgmax=800" width="500" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p align="center"&gt;&lt;strong&gt;-- Look Mom, No Hands!&lt;/strong&gt;&lt;/p&gt;

&lt;p align="center"&gt;&amp;#160;&lt;/p&gt;

&lt;p align="left"&gt;This feature that the last matching closing tag &lt;strong&gt;&lt;font color="#ff0000"&gt;?&amp;gt;&lt;/font&gt;&lt;/strong&gt; is optional at the end of a script file is a peculiarity of the PHP language but it comes to be very handy in this situation.&lt;/p&gt;

&lt;p align="left"&gt;This completes the first part of this quick overview about some of the communication problems of Windows Live Writer with a PHP based blog systems using XML-RPC.&amp;#160; In the next part, we'll see some of the other causes of communication problems that can happen and in particular, we will take a look at the presence of various warning messages that PHP can wrongly insert inside a XML Response under various conditions and that can result into a disrupted XML-RPC communication.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;Copyright © 2009-2010 &lt;a href="http://www.sylvainlafontaine.com/"&gt;&lt;strong style="color: #134753;"&gt;Sylvain Lafontaine&lt;/strong&gt;&lt;/a&gt;.&amp;nbsp; All rights reserved.&lt;br/&gt;
Web site : &lt;a href="http://coding-paparazzi.sylvainlafontaine.com"&gt;&lt;strong style="color: #134753;"&gt;coding-paparazzi.sylvainlafontaine.com&lt;/strong&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; 
Email : &lt;a href="mailto:sylvainlafontaine2009@yahoo.ca"&gt;&lt;strong style="color: #134753;"&gt;sylvainlafontaine2009@yahoo.ca&lt;/strong&gt;&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4597579859901368488-6483733455160189347?l=coding-paparazzi.sylvainlafontaine.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3WJhyZi6guMJgAPnTY_PK49Pw0k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3WJhyZi6guMJgAPnTY_PK49Pw0k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3WJhyZi6guMJgAPnTY_PK49Pw0k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3WJhyZi6guMJgAPnTY_PK49Pw0k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheCodingPaparazzi/~4/fHh8oQI3Lxo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://coding-paparazzi.sylvainlafontaine.com/feeds/6483733455160189347/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://coding-paparazzi.sylvainlafontaine.com/2010/02/solving-connection-problems-wlw.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/6483733455160189347?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/6483733455160189347?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TheCodingPaparazzi/~3/fHh8oQI3Lxo/solving-connection-problems-wlw.html" title="Solving the connection problems of Windows Live Writer (WLW), Part 1" /><author><name>Sylvain Lafontaine</name><uri>http://www.blogger.com/profile/08439067731828915631</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_w76XuJflOGw/S0EvrjQTAqI/AAAAAAAAFc8/MeCzPdBteeg/S220/Sylvain+-+thumbnail,+carre,+54x54px,+version+3.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_w76XuJflOGw/S3pl4D64bsI/AAAAAAAAFqU/oxh-rfpNMDg/s72-c/captured_Image.png3_thumb1.gif?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://coding-paparazzi.sylvainlafontaine.com/2010/02/solving-connection-problems-wlw.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04BRnc8fSp7ImA9WxBQEEw.&quot;"><id>tag:blogger.com,1999:blog-4597579859901368488.post-7320623379602306080</id><published>2009-12-22T05:32:00.001-05:00</published><updated>2010-01-09T01:52:37.975-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-09T01:52:37.975-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Blogger" /><category scheme="http://www.blogger.com/atom/ns#" term="Followers gadget" /><category scheme="http://www.blogger.com/atom/ns#" term="Google Friend Connect" /><category scheme="http://www.blogger.com/atom/ns#" term="Artisteer" /><title>Solving the Google Friend Connect's display problem with Firefox</title><content type="html">&lt;script type="text/javascript"&gt;

var id; // Deliberately unassigned variable.

function w (t) {
  var hw;
  // hw = window.open ("about:blank", id, "")
  hw = window.open ("about:blank", "", "")

  // Le formatage des lignes sera conservé mais les codes HTML pour
  // &amp; " &lt; &gt; seront conservés tels quels.
  hw.document.open ("text/plain");
  hw.document.clear;

  var t2 = t.replace(/&amp;lt;/g, "&lt;").replace(/&amp;gt;/g, "&gt;").replace(/&amp;quot;/g, "\"").replace(/&amp;amp;/g, "&amp;");

  hw.document.write (t2);
  hw.document.close();
  return false;
}

&lt;/script&gt;  &lt;p&gt;&lt;a title="Google Friend Connect" href="http://www.google.com/friendconnect/"&gt;&lt;img title="Google Friend Connect - Logo" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 12px 55px; border-right-width: 0px" height="38" alt="Google Friend Connect - Logo" src="http://lh6.ggpht.com/_w76XuJflOGw/SzCgTGJtUJI/AAAAAAAAFYM/boAGJsCg-lU/GoogleFriendConnectLogo7.gif?imgmax=800" width="270" border="0" /&gt;&lt;/a&gt; &lt;img title="compatible_firefox" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 10px 45px; border-right-width: 0px" height="50" alt="compatible_firefox" src="http://lh4.ggpht.com/_w76XuJflOGw/SzCgT06sLkI/AAAAAAAAFYQ/b0CC9y4h7_A/compatible_firefox6.gif?imgmax=800" width="51" border="0" /&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;On many sites, the Google Friend Connect widget (and its counterpart the Followers gadget for Blogger) will not appear at all or rarely on Firefox.&amp;#160; A solution was published by Google (see &amp;quot;&lt;a href="http://www.google.com/support/forum/p/friendconnect/thread?tid=3e594f4a2cd2795a&amp;amp;hl=en"&gt;Why is my Google Friend Connect rarely displaying on my blog???&lt;/a&gt;&amp;quot; but it seems appropriate only for a group of sites using Prototype.js and remains without effect on other sites.&lt;/p&gt;  &lt;p&gt;This article proposes another solution for this display problem of Google Friend Connect and of the Followers gadget on Firefox for those for whom the solution offered by Google is not appropriate.&amp;#160; It has been tested successfully with different types of templates - including those produced by Artisteer - and for sites hosted on Blogger or not.&amp;#160; A quick way for testing if this solution will be suitable for your site - without having to first modify it - is also provided along the way.&lt;/p&gt; &lt;a name='more'&gt;&lt;/a&gt;&lt;!-- more --&gt;  &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; - the application of this solution requires to have some basic knowledge of javascript and also requires that you are capable to edit the template of your site but the necessary change is relatively simple and a Copy &amp;amp; Paste of the code provided at the end of the article should suffice in most cases.&amp;#160; This article is provided with several examples of code to explain how it works but it is not necessary to understand them to use it and if you want, you can go straight to the end of this article to use the code.&lt;/p&gt;  &lt;p&gt;The examples in this article have been made with the Google Friend Connect &lt;strong&gt;(GFC)&lt;/strong&gt; widget on an Artisteer template hosted on Blogger but this solution is not limited to this configuration only and will also applies to the Followers gadget as well as to other types of templates and hosting services. Those who also have the compatibility issue with Prototype.js will still have to apply the solution provided by Google about JSON; all the necessary explanations for this is also provided in this article.&lt;/p&gt;  &lt;p&gt;You can see various tests done with GFC on the demo site &amp;quot;&lt;a href="http://google-friend-connect-firefox.blogspot.com/"&gt;Google Friend Connect and Firefox&lt;/a&gt;&amp;quot; and see by yourself the difference in results between Internet Explorer (&lt;strong&gt;IE&lt;/strong&gt;) and Firefox with different possible solutions.&amp;#160; It is normal for many of these tests to not display properly on Firefox.&amp;#160; There is an article on this site describing quickly each of these tests but this is only for an illustrative purpose and it does not repeat the explanations already provided here.&lt;/p&gt;  &lt;p&gt;A future article will deal specifically with the specific changes to make for the Followers gadget for those wanting to use it on Blogger instead of Google Friend Connect but overall, the solution is essentially the same as the one described here for GFC.&amp;#160; You can see a second serie of tests done with the Followers gadget on another site: &amp;quot;&lt;a href="http://gadget-followers-firefox.blogspot.com/"&gt;Gadget Followers and FireFox&lt;/a&gt;&amp;quot;.&amp;#160; Remember, it is normal to see several of these tests not displaying properly with Firefox.&lt;/p&gt;  &lt;p&gt;For those who have problems with the display of GFC on Firefox, the solution recommended by Google - and published in the post &amp;quot;&lt;a href="http://www.google.com/support/forum/p/friendconnect/thread?tid=7305b5ff61e1fde3&amp;amp;hl=en"&gt;Google friend connect social bar is blank in Chrome and Safari - Google Friend Connect Help&lt;/a&gt;&amp;quot; by Seth Fitness - is to add the following code between &lt;strong&gt;prototype.js&lt;/strong&gt; and the code of the GFC widget (preferably just before the latter):&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0px"&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;      &lt;br /&gt;&amp;#160; window.JSON = {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; parse: function (st) { return st.evalJSON(); },       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; stringify: function(obj) { return Object.toJSON(obj); }       &lt;br /&gt;&amp;#160; };       &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;This code aims to resolve a problem of incompatibility between &lt;a href="http://translate.googleusercontent.com/translate_c?hl=en&amp;amp;langpair=fr%7Cen&amp;amp;u=http://www.prototypejs.org/&amp;amp;rurl=translate.google.com&amp;amp;twu=1&amp;amp;client=tmpg&amp;amp;usg=ALkJrhisL9kid31uYAVtPU2688uw2zntSw"&gt;prototype.js&lt;/a&gt; and the GFC code by restoring the default JSON parser.&amp;#160; However, if it actually solves the problem for those who have this specific problem of incompatibility, it resolves nothing for others who do not use prototype.js but still have a display problem on Firefox with GFC.&amp;#160; Thus, we can divide the situation into three groups:&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; 1- The problem of incompatibility with prototype.js&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; 2- Another source of problem&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; 3- The first two put together&lt;/p&gt;  &lt;p&gt;Those who have only the first problem may correct their site using the Google fix and be done with it.&amp;#160; However, for the others, you can try with the possible solution offered in this article, either in combination with or without the Google's fix.&amp;#160; I should say that if you don't need it, using nevertheless the fix could broke the solution provided here; so you really need to test it without the fix as well if it doesn't work with it.&lt;/p&gt;  &lt;p&gt;If we exclude the problem of incompatibility with prototype.js, I found that the display problem on Firefox seems to stem from the difficulty that it has to correctly handle the dynamic creation of an &amp;lt;iframe&amp;gt; element within one or more &amp;lt;div&amp;gt; elements when they have not yet been closed; that is to say when the terminal tag &amp;lt;/div&amp;gt; have not yet been parsed:&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0px"&gt;&amp;lt;div&amp;gt;      &lt;br /&gt;&amp;#160; &amp;lt;div&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;&amp;lt;div id=&amp;quot;div-1234567890&amp;quot;&amp;gt;...&amp;lt;/div&amp;gt;        &lt;br /&gt;&lt;/span&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;script&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Code javascript immédiat, créant dynamiquement un&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // élément &amp;lt;iframe&amp;gt; à l'intérieur du &amp;lt;div&amp;gt; précédent.       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/script&amp;gt;       &lt;br /&gt;      &lt;br /&gt;&amp;#160; ... &lt;em&gt;The HTML code that follows here has not yet been parsed and the first        &lt;br /&gt;&amp;#160;&amp;#160; &lt;/em&gt;&lt;em&gt;&amp;#160;&amp;#160; two &amp;lt;div&amp;gt; elements are still open at this point.&amp;#160; The previous javascript        &lt;br /&gt;&lt;/em&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; code will then insert the new &amp;lt;iframe&amp;gt; element inside an open        &lt;br /&gt;&lt;/em&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; hierarchy of &amp;lt;div&amp;gt;; this even if the last &amp;lt;div&amp;gt; above has been closed.        &lt;br /&gt;&lt;/em&gt;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160; &amp;lt;/div&amp;gt;       &lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;In the previous example, the javascript code is inline code; that is to say that it will be run immediately by the browser before the following HTML code is to be parsed.&amp;#160; This also means that at the time of its execution, many of &amp;lt;div&amp;gt; elements which cover it will still be open because their terminal tags &amp;lt;/div&amp;gt; will have not been parsed by the browser and won't be until the inline code is finished.&amp;#160; This is a necessary behavior because it is possible for the inline javascript code to issue (or inject) a new piece of HTML code with a call to document.write and in this case, this new piece will have te be parsed before the remaining HTML code that follows the inline javascript code.&lt;/p&gt;  &lt;p&gt;But as we can see in the previous example, the inline javascript is contained inside two open &amp;lt;div&amp;gt; elements; alongside a previous third &amp;lt;div&amp;gt; element that has been closed but which is itself inside the two open &amp;lt;div&amp;gt;.&amp;#160; This is into this third &amp;lt;div&amp;gt; element - with and ID likes &amp;quot;div-1234567899&amp;quot; and highlighted in yellow - that the Google Friend Connect widget will dynamically create an &amp;lt;iframe&amp;gt; (whose content is the elements for the GFC widget) and add it as a child node.&amp;#160; So, the inline javascript code of the GFC will dynamically create an &amp;lt;iframe&amp;gt; and add it to a closed &amp;lt;div&amp;gt; element but this closed element is itself in an hierarchy of still open one or more &amp;lt;div&amp;gt; elements and that's what Firefox seems to have a problem with.&lt;/p&gt;  &lt;p&gt;If this is really the source of the Firefox's display problem, then we can see that a possible solution would be to make sure that the &amp;lt;div&amp;gt; to receive the soon to be created &amp;lt;iframe&amp;gt; element is not located inside an open hierarchy of &amp;lt;div&amp;gt; when the code execute and this can be easily achieve by a variety of ways; for example:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;1 - Moving the &amp;lt;div&amp;gt; element earlier in the HTML code, before any open open div element.&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;2 - Moving the inline javascript code farther away in the HTML code, after any relevant closing &amp;lt;/div&amp;gt; tag; the best place probably being near the ending &amp;lt;/body&amp;gt; tag.&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;3 - Change the javascript code so that it is no more an inline piece of code with immediat execution and instead, delay its execution at a more appropriate time; such as when the closure &amp;lt;/div&amp;gt; tags have been parsed or even better, after the loading of the final &amp;lt;body&amp;gt; element.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The previous example has been made from an Artisteer template and your own personal mileage will vary but the overall principle should remain the same.&amp;#160; However, it's now the time to take a deeper look at the GFC widget code itself.&amp;#160; One such example of code is shown below.&amp;#160; Some values as the ID for the principal &amp;lt;div&amp;gt; tag (in yellow), the width or the colors will change in your own case but the rest should be identical.&amp;#160; Highlighted in yellow is the &amp;lt;div&amp;gt; designated to receive the &amp;lt;iframe&amp;gt; element and in blue is the method &lt;strong&gt;renderMembersGadget&lt;/strong&gt;. This is the method that will create the &amp;lt;iframe&amp;gt; element and therefore, this is the one that we must delay in one way or another (beside moving the &amp;lt;div&amp;gt; element) if we want to try our solution.&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0px"&gt;&amp;lt;!-- Include the Google Friend Connect javascript library. --&amp;gt;      &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src= &amp;quot;http://www.google.com/friendconnect/script/friendconnect.js&amp;quot;&amp;gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/script&amp;gt;       &lt;br /&gt;      &lt;br /&gt;&amp;lt;!-- Define the div tag where the gadget will be inserted. --&amp;gt;       &lt;br /&gt;      &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;div id=&amp;quot;div-4539487656055420414&amp;quot; style=&amp;quot;width:250px;border:1px solid&amp;#160; &lt;br /&gt;&lt;/span&gt;&lt;span style="background-color: yellow"&gt;&amp;#160;&amp;#160; #cccccc;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;        &lt;br /&gt;        &lt;br /&gt;&lt;/span&gt;&amp;lt;!-- Render the gadget into a div. --&amp;gt;       &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;       &lt;br /&gt;var skin = {};       &lt;br /&gt;&amp;#160; skin['BORDER_COLOR'] = '#cccccc';       &lt;br /&gt;&amp;#160; skin['ENDCAP_BG_COLOR'] = '#e0ecff';       &lt;br /&gt;&amp;#160; skin['ENDCAP_TEXT_COLOR'] = '#333333';       &lt;br /&gt;&amp;#160; skin['ENDCAP_LINK_COLOR'] = '#0000cc';       &lt;br /&gt;&amp;#160; skin['ALTERNATE_BG_COLOR'] = '#ffffff';       &lt;br /&gt;&amp;#160; skin['CONTENT_BG_COLOR'] = '#ffffff';       &lt;br /&gt;&amp;#160; skin['CONTENT_LINK_COLOR'] = '#0000cc';       &lt;br /&gt;&amp;#160; skin['CONTENT_TEXT_COLOR'] = '#333333';       &lt;br /&gt;&amp;#160; skin['CONTENT_SECONDARY_LINK_COLOR'] = '#7777cc';       &lt;br /&gt;&amp;#160; skin['CONTENT_SECONDARY_TEXT_COLOR'] = '#666666';       &lt;br /&gt;&amp;#160; skin['CONTENT_HEADLINE_COLOR'] = '#333333';       &lt;br /&gt;&amp;#160; skin['NUMBER_ROWS'] = '4';       &lt;br /&gt;      &lt;br /&gt;google.friendconnect.container.setParentUrl('/' /* location of rpc_relay.html       &lt;br /&gt;&amp;#160;&amp;#160; and canvas.html */);       &lt;br /&gt;      &lt;br /&gt;&lt;span style="background-color: #d0e3e7"&gt;google.friendconnect.container.renderMembersGadget(&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160; { id: 'div-4539487656055420414',         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; site: '16774183366910057534' },         &lt;br /&gt;&amp;#160;&amp;#160; skin);&lt;/span&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Note that in this example the ID for the main &amp;lt;div&amp;gt; tag is &amp;quot;div-4539487656055420414&amp;quot;.&amp;#160; It's a long number but you can change it to whatever you like (it doesn't even need for the new value to begin with &amp;quot;div-&amp;quot;); all it needs is to be unique among all the other IDs on your site.&amp;#160; It's also interesting to see that the automatic value provided by GFC always begins with &amp;quot;div-&amp;quot;; this way, it make it easy to found it on your site if you need to.&amp;#160; This would prove to be particularly useful in the case of the Followers gadget.&lt;/p&gt;  &lt;p&gt;However, what's more important is that this ID's value is also passed as a parameter to the &lt;strong&gt;renderMembersGadget&lt;/strong&gt; method below; so you can change its value but you must change it at both location.&amp;#160; This is important if you want to take the below examples and try them on your own site.&amp;#160; Beside this ID, you must also change the value identifying the site to GFC: this is the value     &lt;br /&gt;« site: '16774183366910057534' » in the above example which is passed as the second parameter to the renderMembersGadget method and it must be replaced with the value of your own site.&amp;#160; Look at the code provided by GFC to find it.&lt;/p&gt;  &lt;p&gt;The rest of the GFC widget code consists of a link to the javascript file &lt;strong&gt;&amp;quot;friendconnect.js&amp;quot;&lt;/strong&gt; and of lines of code which initializes the variable &lt;strong&gt;skin{}&lt;/strong&gt; with the values for the visual appearance to be displayed by the GFC widget.&amp;#160; There is nothing particular with these lines of code and they can be executed anywhere as long as it is before the call to the renderMembersGadget method.&amp;#160; The same is also true for the call to the &lt;strong&gt;setParentUrl&lt;/strong&gt; method.&lt;/p&gt;  &lt;p&gt;However, the reading of the file &amp;quot;&lt;strong&gt;friendconnect.js&lt;/strong&gt;&amp;quot; might pose a problem in some particular situations: the javascript code for the renderMembersGadget method (which by the way is a member of the google.friendconnect object) is part of this file; so this file must have been loaded before we get the right to call this method.&amp;#160; This is not a problem for the code as it is actually written - the browser will garantee that it has been loading before executing any inline javascript code that follows it - but if we change this inline code so that it's no longer inline, there will be no more any garanty.&amp;#160; Later, we will take a measure to prevent this in the final example.&lt;/p&gt;  &lt;p&gt;The examples that follow have been made using an Artisteer template for Blogger.&amp;#160; Your own situation will likely be different if you are using something else but that's not important for the comprehension of what follow.&amp;#160; I have highlighted in yellow the beginning and ending of two &amp;lt;div&amp;gt; elements that contain the inner &amp;lt;div&amp;gt; and the javascript code that will create the &amp;lt;iframe&amp;gt; for the GFC widget; the later two beeing highlighted in a darker shade of blue.&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;div class='widget HTML' id='HTML3'&amp;gt;&lt;/span&gt;       &lt;br /&gt;&amp;lt;h2 class='title'&amp;gt;Google Friend Connect #1&amp;lt;/h2&amp;gt;       &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;div class='widget-content'&amp;gt;&lt;/span&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&amp;lt;!-- Include the Google Friend Connect javascript library. --&amp;gt;       &lt;br /&gt;&amp;lt;script src= &amp;quot;http://www.google.com/friendconnect/script/friendconnect.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;       &lt;br /&gt;      &lt;br /&gt;&amp;lt;!-- Define the div tag where the gadget will be inserted. --&amp;gt;       &lt;br /&gt;      &lt;br /&gt;&lt;span style="background-color: #d0e3e7"&gt;&amp;lt;div id=&amp;quot;div-7924693163980589398&amp;quot; style=&amp;quot;width:250px;border:1px solid        &lt;br /&gt;&amp;#160; &lt;/span&gt;&lt;span style="background-color: #d0e3e7"&gt;#cccccc;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;        &lt;br /&gt;        &lt;br /&gt;&lt;/span&gt;&amp;lt;!-- Render the gadget into a div. --&amp;gt;       &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;       &lt;br /&gt;var skin = {};&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ...       &lt;br /&gt;      &lt;br /&gt;&lt;span style="background-color: #d0e3e7"&gt;google.friendconnect.container.renderMembersGadget(        &lt;br /&gt;&amp;#160; { id: 'div-7924693163980589398',         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; site: '16774183366910057534' },         &lt;br /&gt;&amp;#160; skin);         &lt;br /&gt;        &lt;br /&gt;&lt;/span&gt;&amp;lt;/script&amp;gt;       &lt;br /&gt;      &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;       &lt;br /&gt;&amp;lt;div class='clear'&amp;gt;&amp;lt;/div&amp;gt;       &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;And as already mentioned, what we need to do is to make sure that inner &amp;lt;div&amp;gt; is not inside any open &amp;lt;div&amp;gt; when the javascript executes; so the first solution would be to move it before them:&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="background-color: #d0e3e7"&gt;&amp;lt;div id=&amp;quot;div-7924693163980589398&amp;quot; style=&amp;quot;width:250px;border:1px&amp;#160; &lt;br /&gt;&amp;#160; &lt;/span&gt;&lt;span style="background-color: #d0e3e7"&gt;solid &lt;/span&gt;&lt;span style="background-color: #d0e3e7"&gt;#cccccc;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;div class='widget HTML' id='HTML3'&amp;gt;&lt;/span&gt;       &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;div class='widget-content'&amp;gt;        &lt;br /&gt;&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160; ...       &lt;br /&gt;      &lt;br /&gt;&lt;span style="background-color: #d0e3e7"&gt;google.friendconnect.container.renderMembersGadget (        &lt;br /&gt;&amp;#160; { id: 'div-7924693163980589398',         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; site: '16774183366910057534' },&amp;#160; &lt;br /&gt;&amp;#160; skin);&lt;/span&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;       &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;and the second solution would be to move instead the javascript code after them:&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;div class='widget HTML' id='HTML3'&amp;gt;&lt;/span&gt;       &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;div class='widget-content'&amp;gt;&lt;/span&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ...       &lt;br /&gt;      &lt;br /&gt;&lt;span style="background-color: #d0e3e7"&gt;&amp;lt;div id=&amp;quot;div-7924693163980589398&amp;quot; style=&amp;quot;width:250px;border:1px&amp;#160; &lt;br /&gt;&lt;/span&gt;&lt;span style="background-color: #d0e3e7"&gt;&amp;#160;&amp;#160;&amp;#160; solid &lt;/span&gt;&lt;span style="background-color: #d0e3e7"&gt;#cccccc;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;        &lt;br /&gt;        &lt;br /&gt;&lt;/span&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;       &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;/div&amp;gt;        &lt;br /&gt;        &lt;br /&gt;&lt;/span&gt;&lt;span style="background-color: #d0e3e7"&gt;google.friendconnect.container.renderMembersGadget (        &lt;br /&gt;&amp;#160; { id: 'div-7924693163980589398',         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; site: '16774183366910057534' },&amp;#160; &lt;br /&gt;&amp;#160; skin);&lt;/span&gt; &lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Finally, the third solution would be to keep both at their same locations but to change the javascript code so that it will no longer be executed immediately but only at a later time; at least after the moment that the closing &amp;lt;/div&amp;gt; will have been parsed.&lt;/p&gt;  &lt;p&gt;On the site &amp;quot;&lt;a href="http://google-friend-connect-firefox.blogspot.com/"&gt;Google Friend Connect and Firefox&lt;/a&gt;&amp;quot;, I made several tests to illustrate some of the above points to varying degrees.&amp;#160; All these test should display correctly under IE but but of course, some of them won't do it on Firefox.&amp;#160; I remind you that this site has been made with an Artisteer template but you won't necessary get the same result using another template.&amp;#160; However, it's my expectation that the solution provided at the end of this article should work for you and this, whatever the template that you are using.&lt;/p&gt;  &lt;p&gt;In the first box, with the title &amp;quot;&lt;strong&gt;Google Friend Connect&lt;/strong&gt;&amp;quot;, we simply have the original code as directly produced by the GFC page, without modification.&amp;#160; Probably that if you test it with Firefox 3.5 or the latest version, Firefox 3.6 Beta 5, this widget won't display at all; unlike with IE.&lt;/p&gt;  &lt;p&gt;The second box, titled &amp;quot;&lt;strong&gt;GFC 1&lt;/strong&gt;&amp;quot;, is simply an empty box excerpt for the inclusion of a comment; so it shouldn't display anything.&amp;#160; This is not very useful but we'll put it to good use in the next article about the Followers gadget and in which we'll need to take a look at the structure of a (empty) gadget on Blogger.&lt;/p&gt;  &lt;p&gt;The following box, titled &amp;quot;&lt;strong&gt;CFA 2&lt;/strong&gt;&amp;quot;, was for the tests that I did make with the solution provided by Google about the compatibility problem between GFC and prototype.js.&amp;#160; As I do not use prototype.js, my expectation was that I would get no positive result and this is exactly what I got.&amp;#160; However, I also found that the simple fact of using this fix when you don't need has a negative effect in the way that the following boxes with the right solution - for my case - were not working anymore after that; so I had to remove this fix from the demo site.&lt;/p&gt;  &lt;p&gt;Then comes the first real test for a potential solution - at least! - which is the use of the &lt;strong&gt;defer&lt;/strong&gt; attribute and which result is shown in the box under the title &amp;quot;&lt;strong&gt;GFC 3 - Defer&lt;/strong&gt;&amp;quot;.&amp;#160; You can find more information about this attribute in the article &amp;quot;&lt;a href="http://www.hunlock.com/blogs/Deferred_Javascript"&gt;Deferred Javascript&lt;/a&gt;&amp;quot; but in our case, all we have to do is to add it to the script element containing the method call to renderMembersGadget:&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ...      &lt;br /&gt;      &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; &lt;span style="background-color: yellow"&gt;defer=&amp;quot;defer&amp;quot;&lt;/span&gt;&amp;gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ...       &lt;br /&gt;      &lt;br /&gt;&lt;span style="background-color: #d0e3e7"&gt;google.friendconnect.container.renderMembersGadget (        &lt;br /&gt;&amp;#160; { id: 'div-7924693163980589398',         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; site: '16774183366910057534' },         &lt;br /&gt;&amp;#160; skin);&lt;/span&gt;       &lt;br /&gt;      &lt;br /&gt;&amp;lt;/script&amp;gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ...&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;This test is also the first one where we get tangible result because with the add of this attribute, Firefox 3.5 will now display the GFC widget correctly on this demo web site.&amp;#160; Unfortunately, this is not the case with the latest version of Firefox, the 3.6 beta 5.&lt;/p&gt;  &lt;p&gt;This special attribute &amp;quot;defer&amp;quot; is an index indicating to the browser that is not necessary for the script element to be executed immediately before the browser can continue the parsing of the remaining HTML elements that follow.&amp;#160; This allows the browser to display the page and return control to the user more quickly; while the processing of the javascript is completed in the background.&amp;#160; Many browser will interpret this as a signal to wait for the parsing of the final &amp;lt;/body&amp;gt; tag before beginning the execution of the scripts with this attribut. However, this interpretion or even any interpretation about this attribute is not mandatory; which explains in part why this potential fix does work with Firefox 3.5 but not with the version 3.6 Beta 5.&lt;/p&gt;  &lt;p&gt;Although unfortunately this does not work with the latest version of Firefox, this result is nevertheless interesting in that it tells us that basically, probably that there is no major error or problem in our template and that the display problem with GFC seems to lie more on the side of Firefox or in the code of the GFC widget instead of beeing in the template itself.&lt;/p&gt;  &lt;p&gt;The two following examples, &lt;strong&gt;GFC 4&lt;/strong&gt; and &lt;strong&gt;5&lt;/strong&gt;, are even more interesting than &lt;strong&gt;#3 &lt;/strong&gt;because we will see the the first solution which will work as well with both the Firefox 3.5 version and the 3.6 beta 5 version.&amp;#160; For these two tests, I separated the code of the GFC widget into two different gadgets; so that the second gadget - the one with the javascript code - will come after any closing &amp;lt;/div&amp;gt; that might present in the first gadget.&lt;/p&gt;  &lt;p&gt;In the first case, the #4, I've put the second gadget right after the first while for the second case, the #5, I put it at the very end of the list of gadgets. This end of the list is not really at the very end of the template itself and many other elements such as the footer and the copyright notice still follow it but in our case, this was sufficient for the case #5 to show correctly on Firefox, including the beta 5 version!&lt;/p&gt;  &lt;p&gt;The test didn't work in the case #4, even if its code is identical to #5; which shows us that the gadgets in this Artisteer template are themselves located inside a deeper hierarchy.&amp;#160; However, because the #5 did work, this also tell us that probably that there is nothing fundamentally wrong in the template itself and that this problem is most likely to be caused by a bug from either Firefox or Google Friend Connect than by a design error with the template.&lt;/p&gt;  &lt;p&gt;If all you need is a working solution, than you don't really need to search any further than the solution used in #5; which is simply to move the javascript code away, toward the end of the HTML page (the &amp;lt;/body&amp;gt; tag).&amp;#160; But there are some interesting points to find by digging deeper and in particular, we'll take a look at how we could test for these different scenarios in the easiest way possible and preferably, without to even have to modify our code and this is exactly what the test &lt;strong&gt;GFC 6&lt;/strong&gt; is all about.&amp;#160; For this one, I've put the javascript code for calling to the renderMembersGadget method inside the clicking event of a button and by clicking it on the demo site, you can see that this method is working perfectly well; not only on IE but also on all versions of Firefox as well.&lt;/p&gt;  &lt;p&gt;Maybe you're not that tempted to install a button for displaying the GFC widget on your site - personally, I am as this will make the loading of the site much faster! - but in reality, this is very insteresting for everyone because it gives us an easy to test this solution on any web site; without having to modify it first.&amp;#160; All we have to do is to copy one line of code, to modify the value of the parameters for the div's and the site's iD, to add &amp;quot;javascript:&amp;quot; at its beginning and finally to paste the result into the address bar of the browser and to execute it by pressing [Enter].&amp;#160; Of course, in the case of the demo site, you don't have to change anything.&lt;/p&gt;  &lt;p&gt;If everything is correct and if you don't need the Google fix, you'll see the elements of the GFC appearing on the page. In the case that you would also need the fix, all you have to do is to add it, too.&amp;#160; A full example for both cases is given below.&amp;#160; Also, in the case of Firefox, you don't have to remove any line break but for IE, everything must be on one line.&amp;#160; You will find below a full example for each of these cases: without or with the fix and on multiple lines or a single one:&lt;/p&gt;  &lt;p&gt;Without the JSON fix: &lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 0px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0px"&gt;javascript:google.friendconnect.container ['renderMembersGadget'] (&lt;/p&gt;    &lt;p&gt;{&amp;#160; id: 'div-6508336042659712443',      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; site: '10657890614271830163'&amp;#160; },       &lt;br /&gt;skin);&lt;/p&gt; &lt;/div&gt; &lt;form id="form1" name="form1"&gt;   &lt;pre style="margin: 0px"&gt;&lt;textarea id="text_area" style="border-right: #b2d1d7 1px solid; border-top: #b2d1d7 1px solid; border-left: #b2d1d7 1px solid; width: 582px; border-bottom: #b2d1d7 1px solid; height: 3em" name="text_area" wrap="off"&gt;javascript:google.friendconnect.container['renderMembersGadget']({id:'div-6508336042659712443',site:'10657890614271830163'},skin);&lt;/textarea&gt;&lt;/pre&gt;

  &lt;p style="margin: 4px 0px 14px"&gt;&lt;button class="art-button" onclick="javascript:document.form1.text_area.focus(); document.form1.text_area.select();"&gt;Select the source code&lt;/button&gt;&amp;#160;&lt;button class="art-button" onclick="javascript:w(document.form1.text_area.innerHTML);"&gt;Open in a new window&lt;/button&gt;&lt;/p&gt;
&lt;/form&gt;

&lt;p&gt;And with the JSON fix:&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 0px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;javascript: window.JSON = { 
    &lt;br /&gt;&amp;#160; parse: function (st) { return st.evalJSON(); }, 

    &lt;br /&gt;&amp;#160; stringify: function(obj) { return Object.toJSON(obj); } 

    &lt;br /&gt;}; 

    &lt;br /&gt;google.friendconnect.container ['renderMembersGadget'] ( 

    &lt;br /&gt;{&amp;#160; id: 'div-6508336042659712443', 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; site: '10657890614271830163'&amp;#160; }, 

    &lt;br /&gt;skin);&lt;/p&gt;
&lt;/div&gt;
&lt;form id="form2" name="form2"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;textarea id="text_area" style="border-right: #b2d1d7 1px solid; border-top: #b2d1d7 1px solid; border-left: #b2d1d7 1px solid; width: 582px; border-bottom: #b2d1d7 1px solid; height: 3em" name="text_area" wrap="off"&gt;javascript:window.JSON={parse: function (st) {return st.evalJSON();}, stringify: function(obj) {return Object.toJSON(obj);}}; google.friendconnect.container['renderMembersGadget']({id:'div-6508336042659712443',site:'10657890614271830163'},skin);&lt;/textarea&gt;&lt;/pre&gt;

  &lt;p style="margin: 4px 0px 14px"&gt;&lt;button class="art-button" onclick="javascript:document.form2.text_area.focus(); document.form2.text_area.select();"&gt;Select the source code&lt;/button&gt;&amp;#160;&lt;button class="art-button" onclick="javascript:w(document.form2.text_area.innerHTML);"&gt;Open in a new window&lt;/button&gt;&lt;/p&gt;
&lt;/form&gt;

&lt;p&gt;Remember that if you don't need the compatibility fix for prototype.js, adding it migh make the problem got worst; so you really have to test for both cases.&lt;/p&gt;

&lt;p&gt;Finally, in the tests &lt;strong&gt;GFC 7, 8&lt;/strong&gt; and &lt;strong&gt;9&lt;/strong&gt;, we'll use the window.onload event to run the code only after the last HTML element of the &amp;lt;body&amp;gt; segment has been parsed and loaded by the browser.&amp;#160; To do this, we first enclose the code inside a function and then we load this function in an event so that it will be run a a later time istead of being executed immediately.&amp;#160; For the first test of this type, the &lt;strong&gt;#7,&lt;/strong&gt; I've used the window.onload event.&amp;#160; The following listing show in yellow the change that I've made to the GFC's original code:&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;&amp;lt;!-- GFC 7 - Onload --&amp;gt; 
    &lt;br /&gt;&amp;lt;!-- Include the Google Friend Connect javascript library. --&amp;gt; 

    &lt;br /&gt;&amp;lt;script src=&amp;quot;http://www.google.com/friendconnect/script/friendconnect.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt; 

    &lt;br /&gt;

    &lt;br /&gt;&amp;lt;!-- Define the div tag where the gadget will be inserted. --&amp;gt; 

    &lt;br /&gt;&lt;strong&gt;&amp;lt;div id=&amp;quot;div-7508336042659712443&amp;quot; 
      &lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160; style=&amp;quot;width:250px;border:1px solid #cccccc;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt; 
      &lt;br /&gt;

      &lt;br /&gt;&lt;/strong&gt;&amp;lt;!-- Render the gadget into a div. --&amp;gt; 

    &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt; 

    &lt;br /&gt;

    &lt;br /&gt;&lt;span style="background-color: yellow"&gt;function DisplayGFC7() {&amp;#160; &lt;br /&gt;

      &lt;br /&gt;&lt;/span&gt;var skin = {}; 

    &lt;br /&gt;

    &lt;br /&gt;&amp;#160; skin['BORDER_COLOR'] = '#cccccc'; 

    &lt;br /&gt;&amp;#160; skin['ENDCAP_BG_COLOR'] = '#e0ecff'; 

    &lt;br /&gt;&amp;#160; skin['ENDCAP_TEXT_COLOR'] = '#333333'; 

    &lt;br /&gt;&amp;#160; skin['ENDCAP_LINK_COLOR'] = '#0000cc'; 

    &lt;br /&gt;&amp;#160; skin['ALTERNATE_BG_COLOR'] = '#ffffff'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_BG_COLOR'] = '#ffffff'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_LINK_COLOR'] = '#0000cc'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_TEXT_COLOR'] = '#333333'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_SECONDARY_LINK_COLOR'] = '#7777cc'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_SECONDARY_TEXT_COLOR'] = '#666666'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_HEADLINE_COLOR'] = '#333333'; 

    &lt;br /&gt;&amp;#160; skin['NUMBER_ROWS'] = '4'; 

    &lt;br /&gt;

    &lt;br /&gt;google.friendconnect.container.setParentUrl('/' /* location of rpc_relay.html 

    &lt;br /&gt;&amp;#160;&amp;#160; and canvas.html */);&amp;#160; &lt;br /&gt;

    &lt;br /&gt;&lt;strong&gt;google.friendconnect.container.renderMembersGadget( 
      &lt;br /&gt;&amp;#160; { id: 'div-7508336042659712443', 

      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; site: '10657890614271830163' }, 

      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; skin); 

      &lt;br /&gt;

      &lt;br /&gt;&lt;/strong&gt;&lt;span style="background-color: yellow"&gt;}&amp;#160; &lt;br /&gt;&lt;/span&gt;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;window.onload = DisplayGFC7; 
      &lt;br /&gt;&lt;/span&gt;

    &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;As you can on the demo site, this method works perfectly with Firefox, all versions.&amp;#160; However, using directly the window.onload event is possibly not the best thing to do.&amp;#160; First, we have to think about the possibility that another event might already be enregistered on this event.&amp;#160; Second, this event will fire not immediately after the parsing of the ending &amp;lt;/body&amp;gt; tag but only when all the images on the page have also been loaded; something which could bring a significant delay on many sites. You will find more information about these point as well as about the window.onload event itself on the following articles: &amp;quot;&lt;a href="http://javascript.about.com/library/blonload.htm"&gt;Using window.onload&lt;/a&gt;&amp;quot;,&amp;#160; &amp;quot;&lt;a href="http://dean.edwards.name/weblog/2005/09/busted/"&gt;Dean Edwards: The window.onload Problem - Solved!&lt;/a&gt;&amp;quot; and &amp;quot;&lt;a href="http://blog.roberthahn.ca/articles/2007/02/02/how-to-use-window-onload-the-right-way/"&gt;How to Use window.onload the Right Way - Robert Hahn&lt;/a&gt;&amp;quot;.&lt;/p&gt;

&lt;p&gt;The article by Dean Edwards mentions the possibility of utilizing the addEventListener method in Firefox in order to accelerate the onset of the event but we must also think about the other browsers on the market.&amp;#160; You can obviously build all the code required by yourselves to get the best option for many cases but those using Artisteer have access to the &lt;strong&gt;artLoadEvent()&lt;/strong&gt; function to ensure an optimum loading:&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;&amp;lt;!-- GFC 8 - artLoadEvent --&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160; ... 

    &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt; 

    &lt;br /&gt;

    &lt;br /&gt;function DisplayGFC8() {&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160; ...&amp;#160; &lt;br /&gt;&amp;#160; google.friendconnect.container.renderMembersGadget(&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; { id: 'div-8508336042659712443', 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; site: '10657890614271830163' },&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; skin); 

    &lt;br /&gt;} 

    &lt;br /&gt;

    &lt;br /&gt;&lt;span style="background-color: yellow"&gt;artLoadEvent.add (function() { DisplayGFC8(); });&lt;/span&gt;&amp;#160; &lt;br /&gt;

    &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Notice that even if the box #8 is located after the #7, it will appears before the later on the demo site because the window.onload event used for the #7 will usually fire later than the event used in the #8.&lt;/p&gt;

&lt;p&gt;Finally, there is also the question - already mentionner earlier - that the code in the file friendconnect.js might not have been loaded yet when the event is triggered; so a call to the &lt;strong&gt;renderMembersGadget&lt;/strong&gt; will fail at this point because it's to early.&amp;#160; Remember that it's only for inline code that the browser will garantee that any previous javascript file has been loaded before attempting to execute the code; so in our case, it's not a bad ideal to add the necessary extra code to make that verification and to step back to come back later if necessary.&amp;#160; This is exactly what's has been added in the next example.&amp;#160; At the beginning of the function, there is a check about the presence of the google.friendconnect object.&amp;#160; If it's not found, a timer is set for the function to be called back in two seconds and the function is then exited.&amp;#160; (See &amp;quot;&lt;a href="http://www.elated.com/articles/javascript-timers-with-settimeout-and-setinterval/"&gt;JavaScript Timers with setTimeout and setInterval&lt;/a&gt;&amp;quot;.&amp;#160; This process is repeated if necessary until success or up to a maximum of 10 retries; for a total maximum of 20 seconds before a timeout.&amp;#160; After that, if the object is still not available, the display of the Google Friend Connect widget is canceled.&lt;/p&gt;

&lt;p&gt;This example uses &lt;strong&gt;artLoadEvent()&lt;/strong&gt; but the code remains the same if you want to use the window.onload instead.&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;&amp;lt;!-- GFC 9- artLoadEvent + setTimeout --&amp;gt; 
    &lt;br /&gt;

    &lt;br /&gt;&amp;lt;!-- Include the Google Friend Connect javascript library. --&amp;gt; 

    &lt;br /&gt;&amp;lt;script src=&amp;quot;http://www.google.com/friendconnect/script/friendconnect.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt; 

    &lt;br /&gt;&amp;lt;!-- Define the div tag where the gadget will be inserted. --&amp;gt; 

    &lt;br /&gt;

    &lt;br /&gt;&amp;lt;div id=&amp;quot;div-9508336042659712443&amp;quot; style=&amp;quot;width:250px;border:1px solid #cccccc;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt; 

    &lt;br /&gt;

    &lt;br /&gt;&amp;lt;!-- Render the gadget into a div. --&amp;gt; 

    &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;#160; &lt;br /&gt;

    &lt;br /&gt;&amp;#160; &lt;span style="background-color: yellow"&gt;var CountGFC9 = 0;&lt;/span&gt; 

    &lt;br /&gt;&amp;#160; &lt;span style="background-color: yellow"&gt;var FlagGFC9 = false;&lt;/span&gt;&amp;#160; &lt;br /&gt;

    &lt;br /&gt;function DisplayGFC9() {&amp;#160; &lt;br /&gt;

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;if (!window.google || !google.friendconnect) {&lt;/span&gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;// Retry for up to 20 seconds.&lt;/span&gt;&amp;#160; &lt;br /&gt;

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;if (CountGFC9 ++ &amp;lt; 10) 
      &lt;br /&gt;&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;// 2 seconds of delay.&lt;/span&gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;setTimeout('DisplayGFC9()', 2000);&lt;/span&gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;else&lt;/span&gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;FlagGFC9 = true;&lt;/span&gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;return;&lt;/span&gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;}&lt;/span&gt;&amp;#160; &lt;br /&gt;

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;if (FlagGFC9 == true)&lt;/span&gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;return;&lt;/span&gt;&amp;#160; &lt;br /&gt;

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;FlagGFC9 = true;&lt;/span&gt;&amp;#160; &lt;br /&gt;

    &lt;br /&gt;var skin = {};&amp;#160; &lt;br /&gt;&amp;#160; skin['BORDER_COLOR'] = '#cccccc'; 

    &lt;br /&gt;&amp;#160; skin['ENDCAP_BG_COLOR'] = '#e0ecff'; 

    &lt;br /&gt;&amp;#160; skin['ENDCAP_TEXT_COLOR'] = '#333333'; 

    &lt;br /&gt;&amp;#160; skin['ENDCAP_LINK_COLOR'] = '#0000cc'; 

    &lt;br /&gt;&amp;#160; skin['ALTERNATE_BG_COLOR'] = '#ffffff'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_BG_COLOR'] = '#ffffff'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_LINK_COLOR'] = '#0000cc'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_TEXT_COLOR'] = '#333333'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_SECONDARY_LINK_COLOR'] = '#7777cc'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_SECONDARY_TEXT_COLOR'] = '#666666'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_HEADLINE_COLOR'] = '#333333'; 

    &lt;br /&gt;&amp;#160; skin['NUMBER_ROWS'] = '4'; 

    &lt;br /&gt;

    &lt;br /&gt;google.friendconnect.container.setParentUrl('/' /* location of 

    &lt;br /&gt;&amp;#160;&amp;#160; rpc_relay.html and canvas.html */);&amp;#160; &lt;br /&gt;

    &lt;br /&gt;google.friendconnect.container.renderMembersGadget( 

    &lt;br /&gt;&amp;#160;&amp;#160; { id: 'div-9508336042659712443', 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; site: '10657890614271830163' }, 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; skin); 

    &lt;br /&gt;} 

    &lt;br /&gt;

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; artLoadEvent.add (function() { DisplayGFC9(); }); 

    &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Are we there yet?&amp;#160; Almost!&amp;#160; There's one last minor problem remaining and this one is about IE.&amp;#160; In my tests with the demo site and for wich there is many GFC widgets, I noticed that often IE will indicate forever that the loading of the page is not yet finished.&amp;#160; This happens very rarely when there is a single GFC widget on the page and is only a minor hassle but still, it leaves me an uneasy feeling (and by the way, it's also an indication that the problem is probably lying inside the GFC code than with Firefox or the template) so I decided to leave the thing unchanged when IE is used.&amp;#160; You can do this in a variety of way but for this case, I chosen to use the conditional comments feature of IE:&lt;/p&gt;

&lt;p&gt;When using the window.onload event:&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;&amp;lt;!--[if IE]&amp;gt; 
    &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;/span&gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;DisplayGFC7(); 
      &lt;br /&gt;&lt;/span&gt;&amp;#160; &lt;span style="background-color: yellow"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt; 

    &lt;br /&gt;&amp;lt;![endif]--&amp;gt; 

    &lt;br /&gt;

    &lt;br /&gt;&amp;lt;![if !ie]&amp;gt; 

    &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;/span&gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;window.onload = DisplayGFC7;&lt;/span&gt; 

    &lt;br /&gt;&amp;#160; &lt;span style="background-color: yellow"&gt;&amp;lt;/script&amp;gt; 
      &lt;br /&gt;&lt;/span&gt;&amp;lt;![endif]&amp;gt;&amp;lt;/![endif]&amp;gt;&amp;lt;/![if&amp;gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;and for the artLoadEvent() function:&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;&amp;lt;!--[if IE]&amp;gt; 
    &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;/span&gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;DisplayGFC9();&lt;/span&gt; 

    &lt;br /&gt;&amp;#160; &lt;span style="background-color: yellow"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt; 

    &lt;br /&gt;&amp;lt;![endif]--&amp;gt; 

    &lt;br /&gt;

    &lt;br /&gt;&amp;lt;![if !ie]&amp;gt; 

    &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;/span&gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;artLoadEvent.add (function() { DisplayGFC9(); });&lt;/span&gt; 

    &lt;br /&gt;&amp;#160; &lt;span style="background-color: yellow"&gt;&amp;lt;/script&amp;gt; 
      &lt;br /&gt;&lt;/span&gt;&amp;lt;![endif]&amp;gt;&amp;lt;/![endif]&amp;gt;&amp;lt;/![if&amp;gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Here's is the final version that I'm curently testing on my blog &lt;a href="http://coding-paparazzi.sylvainlafontaine.com/"&gt;The Coding Paparazzi&lt;/a&gt; :&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;&amp;lt;!-- Followers (GFC) - artLoadEvent() and setTimeout() --&amp;gt; 
    &lt;br /&gt;

    &lt;br /&gt;&amp;lt;!-- Include the Google Friend Connect javascript library. --&amp;gt; 

    &lt;br /&gt;&amp;lt;script&amp;#160; src=&amp;quot;http://www.google.com/friendconnect/script/friendconnect.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt; 

    &lt;br /&gt;

    &lt;br /&gt;&amp;lt;!-- Define the div tag where the gadget will be inserted. --&amp;gt; 

    &lt;br /&gt;&amp;lt;div id=&amp;quot;&lt;span style="background-color: #d0e3e7"&gt;div-2696609035696973039&lt;/span&gt;&amp;quot; style=&amp;quot;width:276px;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt; 

    &lt;br /&gt;

    &lt;br /&gt;&amp;lt;!-- Render the gadget into a div. --&amp;gt; 

    &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;#160; &lt;br /&gt;&amp;#160; var CountFollowers = 0; 

    &lt;br /&gt;&amp;#160; var FlagFollowers = false;&amp;#160; &lt;br /&gt;

    &lt;br /&gt;function DisplayFollowers() { 

    &lt;br /&gt;

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if ((!window.google || !google.friendconnect) { 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Retry for up to 20 seconds. 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (CountFollowers++ &amp;lt; 10) 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // 2 seconds of delay. 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; setTimeout('DisplayFollowers()', 2000); 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; FlagFollowers = true;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }&amp;#160; &lt;br /&gt;

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if (FlagFollowers == true) 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return;&amp;#160; &lt;br /&gt;

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; FlagFollowers = true;&amp;#160; &lt;br /&gt;

    &lt;br /&gt;var skin = {}; 

    &lt;br /&gt;&amp;#160; skin['BORDER_COLOR'] = 'transparent'; 

    &lt;br /&gt;&amp;#160; skin['ENDCAP_BG_COLOR'] = 'transparent'; 

    &lt;br /&gt;&amp;#160; skin['ENDCAP_TEXT_COLOR'] = '#333333'; 

    &lt;br /&gt;&amp;#160; skin['ENDCAP_LINK_COLOR'] = '#0000cc'; 

    &lt;br /&gt;&amp;#160; skin['ALTERNATE_BG_COLOR'] = 'transparent'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_BG_COLOR'] = 'transparent'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_LINK_COLOR'] = '#0000cc'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_TEXT_COLOR'] = '#333333'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_SECONDARY_LINK_COLOR'] = '#7777cc'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_SECONDARY_TEXT_COLOR'] = '#666666'; 

    &lt;br /&gt;&amp;#160; skin['CONTENT_HEADLINE_COLOR'] = '#333333'; 

    &lt;br /&gt;&amp;#160; skin['NUMBER_ROWS'] = '4'; 

    &lt;br /&gt;

    &lt;br /&gt;google.friendconnect.container.setParentUrl('/' /* location of rpc_relay.html and canvas.html */); 

    &lt;br /&gt;

    &lt;br /&gt;google.friendconnect.container.renderMembersGadget( 

    &lt;br /&gt;{ id: '&lt;span style="background-color: #d0e3e7"&gt;div-2696609035696973039&lt;/span&gt;', 

    &lt;br /&gt;&amp;#160;&amp;#160; site: '&lt;span style="background-color: yellow"&gt;12772179594974004608&lt;/span&gt;' }, 

    &lt;br /&gt;&amp;#160; skin); 

    &lt;br /&gt;} 

    &lt;br /&gt;&amp;lt;/script&amp;gt; 

    &lt;br /&gt;

    &lt;br /&gt;&amp;lt;!--[if IE]&amp;gt; 

    &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; DisplayFollowers(); 

    &lt;br /&gt;&amp;#160; &amp;lt;/script&amp;gt; 

    &lt;br /&gt;&amp;lt;![endif]--&amp;gt;&amp;#160; &lt;br /&gt;

    &lt;br /&gt;&amp;lt;![if !ie]&amp;gt; 

    &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;strong&gt;&lt;font color="#ff8000"&gt;artLoadEvent.add (function() { DisplayFollowers(); });&lt;/font&gt;&lt;/strong&gt; 

    &lt;br /&gt;&amp;#160; &amp;lt;/script&amp;gt; 

    &lt;br /&gt;&amp;lt;![endif]&amp;gt;&amp;lt;/![endif]&amp;gt;&amp;lt;/![if&amp;gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;You can use this code directly if you want to, all you have to do is to change the value for the ID of the site (in yellow).&lt;/p&gt;

&lt;p&gt;&lt;font face="Arial" color="#ff0080"&gt;&lt;strong&gt;===&amp;gt;&amp;gt;&lt;/strong&gt;&lt;/font&gt; Also, if you don't use Artisteer then you must also replace the line: &lt;strong&gt;&lt;font color="#ff8000"&gt;artLoadEvent.add (function() { DisplayFollowers(); });&lt;/font&gt;&lt;/strong&gt; with the line: &lt;font color="#ff8000"&gt;&lt;strong&gt;window.onload=DisplayFollowers;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font face="Arial" color="#ff0080"&gt;&lt;strong&gt;===&amp;gt;&amp;gt;&lt;/strong&gt;&lt;/font&gt; Finally, I remind you that you might also need to add the fix for the compatibility problem with prototype.js but only if you need it; otherwise things might get worse.&lt;/p&gt;

&lt;p&gt;The widget for &lt;strong&gt;Google Friend Connect&lt;/strong&gt; can be easily changed because its code is provided to us directly; unfortunately, this is not as easy with the &lt;strong&gt;Followers&lt;/strong&gt; gadget.&amp;#160; In a following article, we will see how to proceed with this gadget. 

  &lt;br /&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p style="border-top: gray 1px dotted; padding-top: 4px"&gt;&lt;font face="Arial" color="#ff0000" size="2"&gt;&lt;strong&gt;&lt;em&gt;-- Erratum, december 22, 2009 --&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;
  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; In the example GFC-9 and in the last listing above, the following line of code (en yellow) contained an error:&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;function DisplayFollowers() { 
    &lt;br /&gt;

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;if ((!google.friendconnect) {&lt;/span&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Retry for up to 20 seconds. &lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;and has been corrected with the following addition, in yellow:&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;function DisplayFollowers() { 
    &lt;br /&gt;

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if ((&lt;span style="background-color: yellow"&gt;!window.google || &lt;/span&gt;!google.friendconnect) {&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Retry for up to 20 seconds. &lt;/p&gt;
&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;Copyright © 2009-2010 &lt;a href="http://www.sylvainlafontaine.com/"&gt;&lt;strong style="color: #134753;"&gt;Sylvain Lafontaine&lt;/strong&gt;&lt;/a&gt;.&amp;nbsp; All rights reserved.&lt;br/&gt;
Web site : &lt;a href="http://coding-paparazzi.sylvainlafontaine.com"&gt;&lt;strong style="color: #134753;"&gt;coding-paparazzi.sylvainlafontaine.com&lt;/strong&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; 
Email : &lt;a href="mailto:sylvainlafontaine2009@yahoo.ca"&gt;&lt;strong style="color: #134753;"&gt;sylvainlafontaine2009@yahoo.ca&lt;/strong&gt;&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4597579859901368488-7320623379602306080?l=coding-paparazzi.sylvainlafontaine.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BdZcEmFQkHXz4IT80XvRe-7oa0k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BdZcEmFQkHXz4IT80XvRe-7oa0k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BdZcEmFQkHXz4IT80XvRe-7oa0k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BdZcEmFQkHXz4IT80XvRe-7oa0k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheCodingPaparazzi/~4/WSgz9dikcfM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://coding-paparazzi.sylvainlafontaine.com/feeds/7320623379602306080/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://coding-paparazzi.sylvainlafontaine.com/2009/12/solving-google-friend-connect-firefox.html#comment-form" title="9 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/7320623379602306080?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/7320623379602306080?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TheCodingPaparazzi/~3/WSgz9dikcfM/solving-google-friend-connect-firefox.html" title="Solving the Google Friend Connect&amp;#39;s display problem with Firefox" /><author><name>Sylvain Lafontaine</name><uri>http://www.blogger.com/profile/08439067731828915631</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_w76XuJflOGw/S0EvrjQTAqI/AAAAAAAAFc8/MeCzPdBteeg/S220/Sylvain+-+thumbnail,+carre,+54x54px,+version+3.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_w76XuJflOGw/SzCgTGJtUJI/AAAAAAAAFYM/boAGJsCg-lU/s72-c/GoogleFriendConnectLogo7.gif?imgmax=800" height="72" width="72" /><thr:total>9</thr:total><feedburner:origLink>http://coding-paparazzi.sylvainlafontaine.com/2009/12/solving-google-friend-connect-firefox.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08ERHwzcSp7ImA9WxBQEE4.&quot;"><id>tag:blogger.com,1999:blog-4597579859901368488.post-4436999494578410233</id><published>2009-12-14T03:20:00.001-05:00</published><updated>2010-01-09T05:10:05.289-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-09T05:10:05.289-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Blogger" /><category scheme="http://www.blogger.com/atom/ns#" term="Artisteer" /><title>Sub-SubMenu for Blogger with Artisteer, part 3 - Dynamic width for the sub-menus</title><content type="html">&lt;script type="text/javascript"&gt;

  var id; // Deliberately unassigned variable: nécessaire si on veut           // réouvrir la même fenêtre tout le temps.

function w (t) {
  var hw;
  // hw = window.open ("about:blank", id, "")
  hw = window.open ("about:blank", "", "")

  // Le formatage des lignes sera conservé mais les codes HTML pour
  // &amp; " &lt; &gt; seront conservés tels quels.
  hw.document.open ("text/plain");
  hw.document.clear;

  var t2 = t.replace(/&amp;lt;/g, "&lt;").replace(/&amp;gt;/g, "&gt;").replace(/&amp;quot;/g, "\"").replace(/&amp;amp;/g, "&amp;");

  hw.document.write (t2);
  hw.document.close();
  return false;
}
&lt;/script&gt;  &lt;p&gt;In parts 1 and 2 of this article on the sub-subMenus for Blogger with Artisteer (see &amp;quot;&lt;a href="http://coding-paparazzi.sylvainlafontaine.com/2009/12/sub-submenu-for-blogger-with-artisteer.html"&gt;Sub-SubMenu for Blogger with Artisteer, part 1&lt;/a&gt;&amp;quot; and « &lt;a href="http://coding-paparazzi.sylvainlafontaine.com/2009/12/sub-submenu-blogger-artisteer-part2.html"&gt;Sub-SubMenu for Blogger with Artisteer, part 2&lt;/a&gt; ») , we have seen how to extend the number of levels of sub menu items for the models ( &amp;quot;templates&amp;quot;) created by Artisteer (version 2.3) for Blogger.&amp;#160; In this part 3, we will improve the visual appearance of these menus by adjusting their width ( &amp;quot;width &amp;quot;) to the size of the option titles they contain.&amp;#160; Note that even if you do not want to use multiple levels of submenus and stay in one, this visual adaptation may still be interesting for you.&amp;#160; It may also be for other users Artisteer using other types of template for Blogger, especially pure HTML templates.&amp;#160; Such alterations will also itself the subject of a future article in order 'clarify its use.&lt;/p&gt;  &lt;a name='more'&gt;&lt;/a&gt; &lt;!-- more --&gt;  &lt;p&gt;Without any further waiting, here's the new replacement code for the function &lt;strong&gt;artDisplayTopMenu&lt;/strong&gt; below:&lt;/p&gt;  &lt;form name="form1"&gt;   &lt;p style="margin: 10px 0px 8px"&gt;&lt;button class="art-button" onclick="javascript:document.form1.text_area.focus(); document.form1.text_area.select();"&gt;Sélectionner le code source&lt;/button&gt;&amp;#160;&lt;button class="art-button" onclick="javascript:w(document.form1.text_area.innerHTML);"&gt;Ouvrir dans une nouvelle fenêtre&lt;/button&gt;&lt;/p&gt;    &lt;pre style="margin: 0px 0px 12px"&gt;&lt;textarea id="text_area" style="border-right: gray 1px solid; border-top: gray 1px solid; border-left: gray 1px solid; width: 582px; border-bottom: gray 1px solid; height: 260px" name="text_area" wrap="off"&gt;// New version for artDisplayTopMenu(); allowing for second and third sub-menu levels.
// First level: option name must begin with a '-'
// Second level: begin with a '-+'
// Third level: begin with a '-+='

// Not HTML escaped so // &amp;lt;![CDATA[ ... // ]]&amp;gt; must be used:
// &amp;lt;![CDATA[

function artDisplayTopMenu (menuitems)
{
    ComputeWidth (menuitems);

    var i = 0;
    var subList = false;
    var subList2 = false;
    var subList3 = false;

    for (i = 0; i &amp;lt; menuitems.length; i++) {
      var item = menuitems[i];
      var itemname = item[0];
      var itemlink = item[1];
      
      var sstyle = '';

      if (item.length &amp;gt;= 3)
         sstyle = item[2];

      if ( ((itemname.indexOf(&amp;quot;=&amp;quot;) == 2) &amp;amp;&amp;amp; !subList3)
        || ((itemname.indexOf(&amp;quot;+&amp;quot;) == 1) &amp;amp;&amp;amp; !subList2)
        || ( (itemname.indexOf(&amp;quot;-&amp;quot;) == 0) &amp;amp;&amp;amp; !subList) ) {
          document.write('&amp;lt;ul&amp;gt;');

      } else if ( ((itemname.indexOf(&amp;quot;=&amp;quot;) != 2) &amp;amp;&amp;amp; subList3)
	|| ((itemname.indexOf(&amp;quot;+&amp;quot;) != 1) &amp;amp;&amp;amp; subList2)
                || ((itemname.indexOf(&amp;quot;-&amp;quot;) != 0) &amp;amp;&amp;amp; subList) ) {

        if ( (itemname.indexOf(&amp;quot;=&amp;quot;) != 2) &amp;amp;&amp;amp; subList3) {
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);
          subList3 = false;
        }

        if ( (itemname.indexOf(&amp;quot;+&amp;quot;) != 1) &amp;amp;&amp;amp; subList2) {
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);
          subList2 = false;
        }

        if ( (itemname.indexOf(&amp;quot;-&amp;quot;) != 0) &amp;amp;&amp;amp; subList) {
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);
          subList = false;
        }

        document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;quot;);

      } else if (i != 0) {
        document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;quot;);
      }
      
      document.write(&amp;quot;&amp;lt;li&amp;gt;&amp;quot;);

      if (itemname.indexOf(&amp;quot;-&amp;quot;) != 0) {
        if (window.location == itemlink) {
          document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot; class=&amp;quot;active&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;l&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;r&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;t&amp;quot;&amp;gt;'+itemname+'&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;');

        } else if(itemlink == &amp;quot;http://./&amp;quot;) {
          document.write('&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;l&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;r&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;t&amp;quot;&amp;gt;'+itemname+'&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;');

        } else {
          document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;l&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;r&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;t&amp;quot;&amp;gt;'+itemname+'&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;');
        }

      } else {

        if (itemname.indexOf(&amp;quot;=&amp;quot;) == 2) {
          document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot; style=&amp;quot;'+sstyle+'&amp;quot;&amp;gt;'+itemname.substr(3,itemname.length)+'&amp;lt;/a&amp;gt;'); 
          subList = true;
          subList2 = true;
          subList3 = true;

        } else if (itemname.indexOf(&amp;quot;+&amp;quot;) == 1) {
          document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot; style=&amp;quot;'+sstyle+'&amp;quot;&amp;gt;'+itemname.substr(2,itemname.length)+'&amp;lt;/a&amp;gt;');
          subList = true;
          subList2 = true;

        } else {
          document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot; style=&amp;quot;'+sstyle+'&amp;quot;&amp;gt;'+itemname.substr(1,itemname.length)+'&amp;lt;/a&amp;gt;');
          subList = true;
        }
      }

      if (i == (menuitems.length-1)) {
        if (subList3)
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);
           
        if (subList2)
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);

        if (subList)
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);

        document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;quot;);
      }
    }
}

function ComputeWidth (menuitems)
{
    // L'élément span 'ruler' doit être formaté exactement (fonte, grosseur, style (italique, caractères gras, etc.) comme les liens
    // dans vos sous-menus et vous le mettez quelque part dans votre modèle Blogger mais avant le menu.  Vous pouvez le mettre
    // visible pendant l'étape de développement pour vous assurez qu'il a le bon formatage exact.

    // The span element 'ruler' must be formated exactly (Font, Size, Style (italic, bold, etc.) as the links in your submenus and it must
    // be put somewhere in your template but before the menu.  While developing, you can make it visible to verify that it has the correct format.

    // Example: &amp;lt;span id=&amp;quot;ruler&amp;quot; style=&amp;quot;visibility:hidden; font-family: 'Times New Roman', Georgia, Times, Serif; font-size: 14px; font-weight: bold; letter-spacing: 1px; &amp;quot;&amp;gt;&amp;lt;/span&amp;gt;

    var rulerSpan = document.getElementById ('ruler');

    // If the 'ruler' &amp;lt;span&amp;gt; element is not found, we are creating a new one here but it will have the wrong formating if you don't modify
    // the following code to your exact requirement.  You can drop this but then, the default width of the submenus will be used.

    if (! rulerSpan) {
      var s = document.createElement ('span');

      // Two different ways to define the style of the element.  Don't forget that the case (lowercase and upercase) is important.
      if (true) {
        s.style.visibility = 'hidden';
        s.style.fontFamily = &amp;quot;'Times New Roman', Georgia, Times, Serif&amp;quot;;
        s.style.fontSize=&amp;quot;14px&amp;quot;;
        s.style.fontWeight=&amp;quot;bold&amp;quot;;
        s.style.letterSpacing=&amp;quot;1px&amp;quot;;
        s.style.position = &amp;quot;absolute&amp;quot;;
        s.style.top = 0;
        s.style.left = 0;
      } else {
        // Two different ways of using a string to define all the style properties.
        var sstyle = &amp;quot;visibility:hidden; font-family: 'Times New Roman', Georgia, Times, Serif; font-size: 14px; font-weight: bold; letter-spacing: 1px; position: absolute; top: 0px; left: 0px;&amp;quot;;
        s.setAttribute(&amp;quot;style&amp;quot;, sstyle);  // Firefox only.
        s.style.cssText = sstyle;         // Firefox &amp;amp; IE.
      } 

      // Two different places on where to insert the new 'span' element into the DOM (Document Object Model) of the page.
      if (true) {
        // Trying to make an appendChild(s) on the 'body' will be an error because this will try to add it at the end
        // of the current list of child but there are some open tags at this point.    
        // document.body.appendChild (s);  // Error to try this!
        document.body.insertBefore(s, document.body.firstChild);
      } else {
        var b = document.getElementById ('LinkList99');
        b.insertBefore(s, b.firstChild);
      }

      rulerSpan = s;
    }

    // Main line of the menu.  We always start from this main line, so there is no need to look
    // if the current itemname has any sub-level tag (&amp;quot;-&amp;quot;, ...) at its beginning at this level.
    var i;
    for (i = 1; i &amp;lt; menuitems.length; ) {
      var item = menuitems [i];
      var itemname = item[0];

      if (itemname.indexOf(&amp;quot;-&amp;quot;) != 0) {
        i++;
      } else {
        // A sub-level has been found; we go down computing it's length and the length of any sub-sub-level that it might contains.
        i = ComputeWidth2 (menuitems, i, rulerSpan);
      }
    }
}

function ComputeWidth2 (menuitems, k, rulerSpan)
{
    var i, j, g, g2, l2;
    var item, itemname;
    var maxLen = 0;

    // Scan the array from position k to find all elements at the same level and their maximum length.
    // If an element from a down level is found, the function is called recursively; if an element from an upper
    // level is found, this mark the end of the current group; the maxLen is written to all of the groups elements
    // and the function return with the index of the first element after the end of the current group.

    for (i = k; i &amp;lt; menuitems.length; ) {
      item = menuitems [i];
      itemname = item[0];

      if (itemname.indexOf(&amp;quot;=&amp;quot;) == 2)
        g2 = 2;  // Third level of submenu.
      else if (itemname.indexOf(&amp;quot;+&amp;quot;) == 1)
        g2 = 1;  // Second level
      else if (itemname.indexOf(&amp;quot;-&amp;quot;) == 0)
        g2 = 0;  // First level
      else
        g2 = -1;  // No submenu: back to the main line.

      if (i == k)
        g = g2;  // Starting point for the group.

      if (g == g2) {
        if (rulerSpan) {
          rulerSpan.innerHTML = itemname.substr (g+1, itemname.length);
          l2 = rulerSpan.offsetWidth;
       } else
          l2 = 0;

        if (l2 &amp;gt; maxLen)
           maxLen = l2;

        i++;

      } else if (g2 &amp;gt; g) {
        // Another sub-level found; we go down and came back with the index of the next element after that sub-group.
        i = ComputeWidth2 (menuitems, i, rulerSpan);

      } else {
        // An upper level element has been found, it's time to finish this group and go back.
        break;
      }
    }

    // If the ruler has not been found, we keep the default length as specified in the Artisteer template.
    if (maxLen != 0) {
      // Adjust the following value of 28px to take into account the margin around the links of your submenus.
      // Ajustez ici la valeur de 28px pour tenir compte des marges entourant les liens de vos sous-menus.
      var swidth = 'width:' + (maxLen + 28) + 'px;';

      // At this point, &amp;quot;i&amp;quot; is the index of the first element after the end of the current group (or the end of the array).
      for (j = k; j &amp;lt; i; j++) {
        item = menuitems [j];
        itemname = item [0];

        // We mark only the elements that are part of the current group and jump over any sub-level element.
        if (itemname.indexOf(&amp;quot;=&amp;quot;) == 2)
          g2 = 2;
        else if (itemname.indexOf(&amp;quot;+&amp;quot;) == 1)
          g2 = 1;
        else if (itemname.indexOf(&amp;quot;-&amp;quot;) == 0)
          g2 = 0;
        else
          g2 = -1;

        // We mark the current element with the maximum width that has been found for the current group.
        if (g == g2)
            item [2] = swidth;
      }
    }

    return i;
}
// ]]&amp;gt;
&lt;/textarea&gt;&lt;/pre&gt;
&lt;/form&gt;

&lt;p&gt;Obviously, this new version of the function artDisplayTopMenu is compatible with the method that we have already seen in &lt;a href="http://coding-paparazzi.sylvainlafontaine.com/2009/12/sub-submenu-blogger-artisteer-part2.html"&gt;Part 2&lt;/a&gt; for replacing the use of the Blogger's &amp;quot;Configure Link List&amp;quot; with a static list of options supplied in the form of JavaScript code.&amp;#160; All you have to do to use the other method is to rename the function in the code above from artDisplayTopMenu to &lt;strong&gt;artDisplayTopMenu2&lt;/strong&gt; and insert the new intermediary function &lt;strong&gt;artDisplayTopMenu&lt;/strong&gt; as it has been described int this &lt;a href="http://coding-paparazzi.sylvainlafontaine.com/2009/12/sub-submenu-blogger-artisteer-part2.html"&gt;Part 2&lt;/a&gt;.&amp;#160; &lt;em&gt;(Remember that you must also add a bogus argument (dummy) in the dynamic list of Blogger as described in this Part 2.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If we look more closely at the code provided, we see that this new version of artDisplayTopMenu first includes a call to &lt;strong&gt;ComputeWidth:&lt;/strong&gt;&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;function artDisplayTopMenu (menuitems) 
    &lt;br /&gt;{ 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;ComputeWidth (menuitems); 
      &lt;br /&gt;&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ...&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The role of this function is to (recursively) scan the array &lt;strong&gt;menuitems&lt;/strong&gt; for calculating the required width for each sub-menu and to store at the position [2] of this array this calculated value. This is the width that needs to be written for each link &amp;lt;a href=&amp;quot;...&amp;quot;&amp;gt; of each submenu; and it's stored in the format &amp;quot;&lt;strong&gt;width: NNpx;&lt;/strong&gt;&amp;quot; with &lt;strong&gt;NN&lt;/strong&gt; representing the number of pixels required.&lt;/p&gt;

&lt;p&gt;Upon the return from this function, the following code will extract this new value for the width that has been calculated and add it to the writing of each HTML link &amp;lt;a href=&amp;quot;...&amp;quot;&amp;gt; as a style attribut:&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;function artDisplayTopMenu (menuitems) 
    &lt;br /&gt;{ 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ... 

    &lt;br /&gt;

    &lt;br /&gt;&amp;#160; &lt;span style="background-color: yellow"&gt;var sstyle = ''; 
      &lt;br /&gt;

      &lt;br /&gt;&lt;/span&gt;&amp;#160; &lt;span style="background-color: yellow"&gt;if (item.length &amp;gt;= 3) 
      &lt;br /&gt;&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;sstyle = item[2]; 
      &lt;br /&gt;&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160; ... 

    &lt;br /&gt;

    &lt;br /&gt;&amp;#160; if (itemname.indexOf(&amp;quot;=&amp;quot;) == 2) { 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; document.write('&amp;lt;a href=&amp;quot;'+itemlink 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; +'&amp;quot; &lt;span style="background-color: yellow"&gt;style=&amp;quot;'+sstyle+'&amp;quot;&lt;/span&gt;&amp;gt;'+itemname.substr(3,itemname.length)+'&amp;lt;/a&amp;gt;'); 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; subList = true; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; subList2 = true; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; subList3 = true; 

    &lt;br /&gt;

    &lt;br /&gt;&amp;#160; } else if (itemname.indexOf(&amp;quot;+&amp;quot;) == 1) { 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; document.write('&amp;lt;a href=&amp;quot;'+itemlink 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; +'&amp;quot; &lt;span style="background-color: yellow"&gt;style=&amp;quot;'+sstyle+'&amp;quot;&lt;/span&gt;&amp;gt;'+itemname.substr(2,itemname.length)+'&amp;lt;/a&amp;gt;'); 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; subList = true; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; subList2 = true; 

    &lt;br /&gt;

    &lt;br /&gt;&amp;#160; } else { 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; document.write('&amp;lt;a href=&amp;quot;'+itemlink 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; +'&amp;quot; &lt;span style="background-color: yellow"&gt;style=&amp;quot;'+sstyle+'&amp;quot;&lt;/span&gt;&amp;gt;'+itemname.substr(1,itemname.length)+'&amp;lt;/a&amp;gt;'); 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; subList = true; 

    &lt;br /&gt;&amp;#160; } 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ...&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Let us now take a look at this function &amp;quot;ComputeWidth&amp;quot;. First, we see that it is divided into two parts: the first initializes some variables and then starts analysing the array &amp;quot;menuitems&amp;quot; for elements that are part of a sub-menu (all other elements are, of course, part of the main menu). When such an item is found - which mean that we are at the beginning of a first level sub-menu -the &lt;strong&gt;ComputeWidth2&lt;/strong&gt; function is called with the index of this element passed as parameter.&amp;#160; This second function will search for all the other elements belonging to the same sub-menu, will determine the greatest width of text needed to display them all and will then enter this value in the array &amp;quot;menuitems&amp;quot; at the position [2] for each element to be part of this same sub-menu.&lt;/p&gt;

&lt;p&gt;&amp;quot;ComputeWidth2&amp;quot; is also the function that will call itself recursively for analysing any sub-level menu that will be encoutered while analysing a first level sub-menu.&amp;#160; When a sub-menu if finished - with all of its sub-level sub-menus as well - the function return with the index of the next element pass the end of the current sub-menu.&amp;#160; The calling function can then resume its analysis of the submenu or of the main menu (if the calling function was ComputeWidth) that it was analysing before encountering a sub-level menu.&amp;#160; The whole hierarchy of the main menu with its submenus and their own submenus is in this way recursively analysed.&lt;/p&gt;

&lt;p&gt;As this process is done recursively, you can see that it will be very easy to add additional levels if we wish too.&amp;#160; This is something that we'll see in a forthcoming article; where we'll take a look at some more advanced functionality to add to our menus.&lt;/p&gt;

&lt;p&gt;In order to facilitate its comprehension, I've added some more comments to the code provided for these two functions.&amp;#160; Howeer, there are some points that need to be discusssed in much greater details. The first one is the method used to calculate the width in pixels of each option.&amp;#160; For this I use the technique seen in the article &amp;quot;&lt;a href="http://bytes.com/topic/javascript/answers/89923-determining-string-length-pixels"&gt;Determining string length in pixels [-JavaScript / Ajax / DHTML answers]&lt;/a&gt;&amp;quot;; which use an hidden &amp;lt;span&amp;gt; text element into which each piece of text is written and then its exact length in pixels found by retrieving the &lt;strong&gt;offsetWidth&lt;/strong&gt; property of the &amp;lt;span&amp;gt; element.&lt;/p&gt;

&lt;p&gt;To use this method, we must first add an element &amp;lt;span&amp;gt; - with an ID equal to &amp;quot;ruler&amp;quot; - to the template and format it exactly the same way as for the submenus' options.&amp;#160; For doing this properly, we must not forget to add the styling properties that are beeing inherited and, of course, we are only interested int the properties related to the size of text; excluding other properties like its colors. To be sure that you have the correct formatting, you can also choose to display this &amp;lt;span&amp;gt; element instead of keeping it hidden during the development process.&amp;#160; This way, you will quickly notice it if you have made any mistake in its formating.&lt;/p&gt;

&lt;p&gt;If this &amp;lt;span&amp;gt; element with an ID of &amp;quot;ruler&amp;quot; is not present in the template or is not found - for example because it has been written later in the HTML code, after the menu section, the function ComputeWidth will create one, format it with a basic style and install it at the beginning of the HTML code (or DOM) of the page.&amp;#160; Therefore, it's not strictly necessary for you to create this &amp;lt;span&amp;gt; element but in this case, you should change the basic style used in the function ComputeWidth so that the basic style will fit your needs:&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;function CompuetWidth (menuitems) 
    &lt;br /&gt;{ 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ... 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; s.style.visibility = 'hidden'; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; s.style.fontFamily = &amp;quot;'Times New Roman', Georgia, Times, Serif&amp;quot;; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; s.style.fontSize = &amp;quot;14px&amp;quot;; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; s.style.fontWeight = &amp;quot;bold&amp;quot;; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; s.style.position = &amp;quot;absolute&amp;quot;; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; s.style.top = 0; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; s.style.left = 0; 

    &lt;br /&gt;

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; /* s.style.letterSpacing = &amp;quot;1px&amp;quot;; */ 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ...&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;em&gt;(In the code provided at the beginning of this article, two different ways for setting this style are shown and obviously, you can choose which one is better suiting your case.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To be sure that this element will not change in anything the display of the page, its position is declared as of type &amp;quot;absolute&amp;quot; in the style.&amp;#160; This way, its size will have no effect on the display of the HTML elements that follow.&amp;#160; Note that even by using a position of type &amp;quot;absolute&amp;quot;, this doesn't mean that you can insert this element anywhere in the HTML page.&amp;#160; When this code for inserting the element of the menu is executing, there are many &amp;lt;div&amp;gt; elements that have been opened but not closed (these elements will be closed only after the last items of the menu have been written).&amp;#160; Inserting a new element at the end of the list at this step means inserting it inside an open &amp;lt;div&amp;gt; element while is it beeing analysed/treated by the browser; something that many won't like.&amp;#160; In the case of IE, most likely you&amp;lt;ll get an javascript error or worse, the page won't display at all as the following figure is showing:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_w76XuJflOGw/SyX1GLFwmnI/AAAAAAAAFS8/DpASKUVBB1A/s1600-h/captured_Image.png59.gif" target="_blank"&gt;&lt;img title="captured_Image.png[5]" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="318" alt="captured_Image.png[5]" src="http://lh3.ggpht.com/_w76XuJflOGw/SyX1Gu-nZZI/AAAAAAAAFTA/Bq6-X6p7qvs/captured_Image.png5_thumb7.gif?imgmax=800" width="500" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The method used in the provided code insert the element by calling &amp;quot;&lt;strong&gt;document.body.insertBefore (s, document.body.firstChild)&lt;/strong&gt;&amp;quot; and is totally safe because this new element will then be inserted at the very beginning of the DOM's hierarchy, therefore making it impossible to be inserted into an open &amp;lt;div&amp;gt; element.&lt;/p&gt;

&lt;p&gt;The second point worth to be mentionned here is the margin required around the menu titles. The method used for calculating the exact length in pixels of each title will ignore the calculation of margin requirements; so this is something that we'll have to add. The code in the function ComputeWidth2 () takes this into account by adding a fixed value of 28 pixels, which matches the style of my menus (with margin of 14 pixels per side) but you can obviously adapt this value to your needs:&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;function ComputeWidth2 (menuitems) 
    &lt;br /&gt;{ 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ... 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; var swidth = 'width:' + (maxLen + &lt;span style="background-color: yellow"&gt;28&lt;/span&gt;) + 'px;'; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ...&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Notice that if you add a proper padding to the style (of formating) of the &amp;lt;span&amp;gt; element; you won't have to correct the value for the margin because the value of this padding will be included into the length in pixel of the text element.&amp;#160; However, if you add a margin to the style instead of a padding; its value won't be taken into account for the length in pixel.&lt;/p&gt;

&lt;p&gt;You can see the end result of this adjustment function menus on the demo site &amp;quot;&lt;a href="http://test3-sub-submenu-artisteer-blogger.blogspot.com/"&gt;Test3 - Sub-SubMenu with Artisteer&lt;/a&gt;&amp;quot; :&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_w76XuJflOGw/SyX1H_ounII/AAAAAAAAFTE/h7O_FygDdH0/s1600-h/captured_Image.png1215.gif" target="_blank"&gt;&lt;img title="captured_Image.png[12]" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="359" alt="captured_Image.png[12]" src="http://lh4.ggpht.com/_w76XuJflOGw/SyX1IuUgFgI/AAAAAAAAFTI/ay90o3zdfhI/captured_Image.png12_thumb13.gif?imgmax=800" width="500" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;You can see on this figure that the widths for the sub-menus of level 1, 2 and 3 have all been correctly calculated and if you take a look with either Firefox or IE6, the result is totally correct. However, on IE7 and IE8, there is a big space that appears between the second and third sub-levels (the latter being indicated by the arrow) as it's indicated by the circle in the previous figure.&lt;/p&gt;

&lt;p&gt;The display problem with IE7 and IE8 comes from a minor problem in the stylesheet as it is generated by Artisteer and which defines for the left margin of the links &amp;lt;a&amp;gt; elements of the submenus a default value of &amp;quot;auto&amp;quot;:&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;.art-menu ul ul a 
    &lt;br /&gt;{ 

    &lt;br /&gt;&amp;#160;&amp;#160; margin-left: &lt;span style="background-color: yellow"&gt;auto&lt;/span&gt;; 

    &lt;br /&gt;}&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;This has the effect of centering more or less the last submenu in its area, as you can see by comparing his position with the position of the previous sub-menu in the figure below, where I have superimposed the two:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_w76XuJflOGw/SyX1Jnla7gI/AAAAAAAAFTM/VSPmxbUryDM/s1600-h/captured_Image.png1410.gif" target="_blank"&gt;&lt;img title="captured_Image.png[14]" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="359" alt="captured_Image.png[14]" src="http://lh6.ggpht.com/_w76XuJflOGw/SyX1KMrM00I/AAAAAAAAFTQ/wehGYMaDC5I/captured_Image.png14_thumb8.gif?imgmax=800" width="500" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The solution is simple: setting the left margin to zero (0) instead of &amp;quot;auto&amp;quot;:&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;.art-menu ul ul a 
    &lt;br /&gt;{ 

    &lt;br /&gt;&amp;#160;&amp;#160; margin-left: &lt;span style="background-color: yellow"&gt;0px&lt;/span&gt;; 

    &lt;br /&gt;}&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Personally, I have no idea why the value of this margin is to &amp;quot;auto&amp;quot; by default instead of being set to 0. This value of &amp;quot;auto&amp;quot; for the margins is usually used for centering an element on the page but in the case of a sub-menu, I see no reason why this value should be variable and left to the discretion of the browser. Having a margin to be variable is probably one the last thing that you want to see in a sub-menu; especially when there are multiple levels involved.&lt;/p&gt;

&lt;p&gt;The final result for our menu is shown on the demo site &amp;quot;&lt;a href="http://test3b-sub-submenu-artisteer-blogger.blogspot.com/"&gt;Test 3.B - Sub-SubMenu with Artisteer&lt;/a&gt;&amp;quot;:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_w76XuJflOGw/SyX1LHjF05I/AAAAAAAAFTU/tsq5Lyc0kmc/s1600-h/captured_Image.png1612.gif" target="_blank"&gt;&lt;img title="captured_Image.png[16]" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="359" alt="captured_Image.png[16]" src="http://lh5.ggpht.com/_w76XuJflOGw/SyX1MAW_iHI/AAAAAAAAFTY/3QKApJiZvo0/captured_Image.png16_thumb10.gif?imgmax=800" width="500" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see on this demo that all the sub-menus are now displaying correctly (red arrow), with a correct width and without any unwanted space between them.&amp;#160; This is not only for Firefox and IE6 but for IE7 and IE8 as well. The screenshot above was made with IE7.&lt;/p&gt;

&lt;p&gt;This concludes the Part 3 of the article on the sub-menus for Blogger with Artisteer. In Part 4 and 5, we will first see some more advanced techniques to enable us to create (and debug) our menus faster and then in some later parts, we'll take a look on how to add some new exciting features to our menus on Blogger.&amp;#160; We will also take a look on how to use these menus with Artisteer templates other than Blogger.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;Copyright © 2009-2010 &lt;a href="http://www.sylvainlafontaine.com/"&gt;&lt;strong style="color: #134753;"&gt;Sylvain Lafontaine&lt;/strong&gt;&lt;/a&gt;.&amp;nbsp; All rights reserved.&lt;br/&gt;
Web site : &lt;a href="http://coding-paparazzi.sylvainlafontaine.com"&gt;&lt;strong style="color: #134753;"&gt;coding-paparazzi.sylvainlafontaine.com&lt;/strong&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; 
Email : &lt;a href="mailto:sylvainlafontaine2009@yahoo.ca"&gt;&lt;strong style="color: #134753;"&gt;sylvainlafontaine2009@yahoo.ca&lt;/strong&gt;&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4597579859901368488-4436999494578410233?l=coding-paparazzi.sylvainlafontaine.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bWcNVd5Pb6pnA_8YBgtrvEIKVuM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bWcNVd5Pb6pnA_8YBgtrvEIKVuM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bWcNVd5Pb6pnA_8YBgtrvEIKVuM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bWcNVd5Pb6pnA_8YBgtrvEIKVuM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheCodingPaparazzi/~4/q2rD0pLLxV4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://coding-paparazzi.sylvainlafontaine.com/feeds/4436999494578410233/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://coding-paparazzi.sylvainlafontaine.com/2009/12/sub-submenu-blogger-artisteer-part3.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/4436999494578410233?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/4436999494578410233?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TheCodingPaparazzi/~3/q2rD0pLLxV4/sub-submenu-blogger-artisteer-part3.html" title="Sub-SubMenu for Blogger with Artisteer, part 3 - Dynamic width for the sub-menus" /><author><name>Sylvain Lafontaine</name><uri>http://www.blogger.com/profile/08439067731828915631</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_w76XuJflOGw/S0EvrjQTAqI/AAAAAAAAFc8/MeCzPdBteeg/S220/Sylvain+-+thumbnail,+carre,+54x54px,+version+3.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_w76XuJflOGw/SyX1Gu-nZZI/AAAAAAAAFTA/Bq6-X6p7qvs/s72-c/captured_Image.png5_thumb7.gif?imgmax=800" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://coding-paparazzi.sylvainlafontaine.com/2009/12/sub-submenu-blogger-artisteer-part3.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08CQ3k_eSp7ImA9WxBQEE8.&quot;"><id>tag:blogger.com,1999:blog-4597579859901368488.post-6491967371853893673</id><published>2009-12-10T16:04:00.001-05:00</published><updated>2010-01-09T04:37:42.741-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-09T04:37:42.741-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Blogger" /><category scheme="http://www.blogger.com/atom/ns#" term="Artisteer" /><title>Sub-SubMenu for Blogger with Artisteer, part 2</title><content type="html">&lt;script type="text/javascript"&gt;

  var id; // Deliberately unassigned variable: nécessaire si on veut           // réouvrir la même fenêtre tout le temps.

function w (t) {
  var hw;
  // hw = window.open ("about:blank", id, "")
  hw = window.open ("about:blank", "", "")

  // Le formatage des lignes sera conservé mais les codes HTML pour
  // &amp; " &lt; &gt; seront conservés tels quels.
  hw.document.open ("text/plain");
  hw.document.clear;

  var t2 = t.replace(/&amp;lt;/g, "&lt;").replace(/&amp;gt;/g, "&gt;").replace(/&amp;quot;/g, "\"").replace(/&amp;amp;/g, "&amp;");

  hw.document.write (t2);
  hw.document.close();
  return false;
}
&lt;/script&gt;  &lt;p&gt;The revised &lt;strong&gt;artDisplayTopMenu()&lt;/strong&gt; function that we have seen in the first part of this article (see &amp;quot;&lt;a href="http://coding-paparazzi.sylvainlafontaine.com/2009/12/sub-submenu-for-blogger-with-artisteer.html"&gt;Sub-SubMenu for Blogger with Artisteer, part 1&lt;/a&gt;&amp;quot;) is interesting but it still has its flaws: firstly, it is not recursive, so it cannot give us an unlimited number of levels: if you need access to a fourth level, you'll have to modify it. Also, it doesn't include any control error; for example if you make a mistake about the order of tags &amp;quot;&lt;strong&gt;-&amp;quot;&lt;/strong&gt;, &amp;quot;&lt;strong&gt;-+&amp;quot;&lt;/strong&gt; and &amp;quot;&lt;strong&gt;-+=&amp;quot;&lt;/strong&gt;. However, these are moot points in comparaison to its main problem: the difficulty that we'll have to manage the long series of options for the menu by using the standard configuration dialog of Blogger. In effect, if you need a second or a third level, for your menus, it's because you have tens or even hundreds of options to put there. For example, although the demonstration site &lt;a href="http://translate.googleusercontent.com/translate_c?hl=en&amp;amp;langpair=fr%7Cen&amp;amp;u=http://test-sub-submenu-artisteer-blogger.blogspot.com/&amp;amp;rurl=translate.google.com&amp;amp;twu=1&amp;amp;client=tmpg&amp;amp;usg=ALkJrhhW0FOUWAlyEiXPo3Xqn_gjBc0UKg"&gt;Sub-SubMenu for Blogger with Artisteer&lt;/a&gt; contains only a tiny fraction of a menu that I'm building for another blog, manage it already requires a very long long series of clicks for inserting a new option or moving them around:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_w76XuJflOGw/S0hOYxSOKTI/AAAAAAAAFhU/bU_9eknupC0/s1600-h/captured_Image.png%5B7%5D.gif" target="_blank"&gt;&lt;img title="captured_Image.png" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="141" alt="captured_Image.png" src="http://lh5.ggpht.com/_w76XuJflOGw/SyFiLF5D70I/AAAAAAAAFhY/c7F1HQtTKH0/captured_Image.png_thumb%5B1%5D.gif?imgmax=800" width="500" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The final menu will be tens of times longer than that, with around one hundred options for the french version and the same for the engligh version; making its management prohibitively time consuming. In this part 2 of this article about sub-menus, Blogger and Artisteer, we will see how to solve this problem.&lt;/p&gt; &lt;a name='more'&gt;&lt;/a&gt;&lt;!-- more --&gt;  &lt;p&gt;If we take a look at the widget's source code that will inserts the HTML items (&amp;lt;ul&amp;gt;, &amp;lt;li&amp;gt; tags, etc.) for the menu, we see that this is mainly a XML loop (the &lt;strong&gt;&amp;lt;b:loop ...&lt;/strong&gt; in the figure below) that is running on the server; ie., before the HTML is sent back the client's browser. &lt;em&gt;(Note: don't forget that you must first check the &amp;quot;Expand Widget Templates&amp;quot; option if you want to see this piece of code.)&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;img title="captured_Image.png309" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="336" alt="captured_Image.png309" src="http://lh3.ggpht.com/_w76XuJflOGw/SyFiMTyEMJI/AAAAAAAAFQA/BkMbAUFtH8o/captured_Image.png3095.gif?imgmax=800" width="500" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;This loop will builds a list of items with the Javascript code necessary to store them one by one in the dynamic array &lt;strong&gt;menuitems&lt;/strong&gt;; you can see part of the final result below. This list of menuitems.push(...) is part of the javascript code inside the HTML page that is sent to the browser client.&amp;#160; Once there, this code will be executed by the client's browser's javascript interpreter. As this part will run locally on your machine (unlike the XML loop which is executed on the server), you can see it by looking directly at the source code of the page in your browser (use the &amp;quot;View Source&amp;quot; or its equivalent on the menu of your browser):&lt;/p&gt; &lt;form name="form1"&gt;   &lt;p style="margin: 10px 0px 8px"&gt;&lt;button class="art-button" onclick="javascript:document.form1.text_area.focus(); document.form1.text_area.select();"&gt;Select the source code&lt;/button&gt;&amp;#160;&lt;button class="art-button" onclick="javascript:w(document.form1.text_area.innerHTML);"&gt;Open in a new window&lt;/button&gt;&lt;/p&gt;    &lt;pre style="margin: 0px 0px 12px"&gt;&lt;textarea id="text_area" style="border-right: gray 1px solid; border-top: gray 1px solid; border-left: gray 1px solid; width: 582px; border-bottom: gray 1px solid; height: 260px" name="text_area" wrap="off"&gt;...

                  menuitems.push(new Array('Site web (français)','http://www.sylvainlafontaine.com/'));
                
                  menuitems.push(new Array('-Blogues','http://paparazzi-codeur.sylvainlafontaine.com/'));
                
                  menuitems.push(new Array('-+Access, ADP et SQL-Server','http://access-adp-sqlserver-francais.sylvainlafontaine.com/'));
                
                  menuitems.push(new Array('-+Le Paparazzi~Codeur','http://paparazzi-codeur.sylvainlafontaine.com/'));
                
                  menuitems.push(new Array('-La Transformée de Fourier','http://transformee-fourier.sylvainlafontaine.com/'));
                
                  menuitems.push(new Array('-+Chapitre 1 - Les Séries de Fourier','http://transformee-fourier.sylvainlafontaine.com/2009/11/chapitre-1-les-series-de-fourier.html'));
                
                  menuitems.push(new Array('-+=A- Principe des Séries de Fourier','http://transformee-fourier.sylvainlafontaine.com/2009/11/chapitre-1-les-series-de-fourier.html#A- Principe des Séries de Fourier'));
                
                  menuitems.push(new Array('-+=B- Les Séries de Fourier','http://transformee-fourier.sylvainlafontaine.com/2009/11/chapitre-1-les-series-de-fourier_29.html#B- Les Séries de Fourier'));
                
                  menuitems.push(new Array('-+Chapitre 2 - La diffraction aux rayons-X','http://transformee-fourier.sylvainlafontaine.com/2009/11/chapitre-2-la-diffraction-aux-rayons-x.html'));
                
                  menuitems.push(new Array('-+=A- Loi de Laue','http://transformee-fourier.sylvainlafontaine.com/2009/11/chapitre-2-la-diffraction-aux-rayons-x.html#Loi de Laue'));
                
                  menuitems.push(new Array('-+=B- Les réseaux cristallins','http://transformee-fourier.sylvainlafontaine.com/2009/11/chapitre-2-la-diffraction-aux-rayons-x_29.html#B- Les réseaux cristallins'));
                
                  menuitems.push(new Array('Web site (english)','http://english.sylvainlafontaine.com/'));
                
                  menuitems.push(new Array('-Blogs','http://coding-paparazzi.sylvainlafontaine.com/'));
                
                  menuitems.push(new Array('-+Access, ADP and SQL-Server','http://access-adp-sqlserver.sylvainlafontaine.com/'));
                
                  menuitems.push(new Array('-+The Coding Paparazzi','http://coding-paparazzi.sylvainlafontaine.com/'));
                
                  menuitems.push(new Array('-The Fourier Transform','http://fourier-transform.sylvainlafontaine.com/'));
                
                  menuitems.push(new Array('-+Chapter 1 - The Fourier Series','http://fourier-transform.sylvainlafontaine.com/2009/11/chapter-1-fourier-series.html'));
                
                  menuitems.push(new Array('-+=A- The Principle of Fourier Series','http://fourier-transform.sylvainlafontaine.com/2009/11/chapter-1-fourier-series.html#A- The Principle of Fourier Series'));
                
                  menuitems.push(new Array('-+=B- The Fourier Series','http://fourier-transform.sylvainlafontaine.com/2009/11/chapter-1-fourier-series-section-b.html#B- The Fourier Series'));
                
                  menuitems.push(new Array('-+Chapter 2 - The X-Ray Diffraction','http://fourier-transform.sylvainlafontaine.com/2009/11/chapter-2-x-ray-diffraction.html'));
                
                  menuitems.push(new Array('-+=A- Laue\'s law','http://fourier-transform.sylvainlafontaine.com/2009/11/chapter-2-x-ray-diffraction.html#Laue'));
                
                  menuitems.push(new Array('-+=B- Crystalline networks','http://fourier-transform.sylvainlafontaine.com/2009/11/chapter-2-x-ray-diffraction-section-b.html#Crystalline networks'));
                
                artDisplayTopMenu(menuitems);
            &amp;lt;/script&amp;gt;&amp;lt;/span&amp;gt;
&amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;
...
&lt;/textarea&gt;&lt;/pre&gt;
&lt;/form&gt;

&lt;p&gt;The array &lt;strong&gt;menuitems&lt;/strong&gt; and the first item of the menu's list (usually &amp;quot;Home&amp;quot; but &amp;quot;Accueil&amp;quot; in the example below) have already been created by the template Artisteer in a piece of javascript code just before that:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_w76XuJflOGw/SyFiNKtv5BI/AAAAAAAAFQE/rRIcj6yFtv0/s1600-h/captured_Image.png215.gif" target="_blank"&gt;&lt;img title="captured_Image.png[21]" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="170" alt="captured_Image.png[21]" src="http://lh6.ggpht.com/_w76XuJflOGw/SyFiPWTzZSI/AAAAAAAAFQI/mJokn_dnvT0/captured_Image.png21_thumb3.gif?imgmax=800" width="552" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the array &lt;strong&gt;menuitems&lt;/strong&gt; has been completed, the &lt;strong&gt;artDisplayTopMenu()&lt;/strong&gt; function is called, with the array passed in as parameter:&lt;/p&gt;

&lt;p&gt;&lt;img title="captured_Image.png[25]" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="99" alt="captured_Image.png[25]" src="http://lh4.ggpht.com/_w76XuJflOGw/SyFiQKMq92I/AAAAAAAAFQM/6xG3c_U_mH0/captured_Image.png255.gif?imgmax=800" width="498" border="0" /&gt; &lt;/p&gt;

&lt;p&gt;To get rid of the need to use the &amp;quot;Configure Link List&amp;quot; window of Blogger, what we have to do would be simply to replace the function &lt;strong&gt;artDisplayTopMenu()&lt;/strong&gt; with a new one that will have the necessary static code to build this list.&amp;#160; After that, a call to the original function artDisplayTopMenu() - renamed for the occasion &lt;strong&gt;artDisplayTopMenu2&lt;/strong&gt; - will build the HTML menu but now by using our own version of the &lt;strong&gt;menuitems&lt;/strong&gt; array:&lt;/p&gt;
&lt;form name="form2"&gt;
  &lt;p style="margin: 10px 0px 8px"&gt;&lt;button class="art-button" onclick="javascript:document.form2.text_area.focus(); document.form2.text_area.select();"&gt;Select the source code&lt;/button&gt;&amp;#160;&lt;button class="art-button" onclick="javascript:w(document.form2.text_area.innerHTML);"&gt;Open in a new window&lt;/button&gt;&lt;/p&gt;

  &lt;pre style="margin: 0px 0px 12px"&gt;&lt;textarea id="text_area" style="border-right: gray 1px solid; border-top: gray 1px solid; border-left: gray 1px solid; width: 582px; border-bottom: gray 1px solid; height: 260px" name="text_area" wrap="off"&gt;// New version for artDisplayTopMenu(); allowing for
// second and third sub-menu levels.
// First level: option name must begin with a '-'
// Second level: begin with a '-+'
// Third level: begin with a '-+='

// Not HTML escaped so // &amp;lt;![CDATA[ ... // ]]&amp;gt; must be used:
// &amp;lt;![CDATA[

function artDisplayTopMenu(menuitems_dummy)
{
  var menuitems = new Array();

  menuitems.push(new Array('Accueil • ','http://test-sub-submenu-artisteer-blogger.blogspot.com/'));

  menuitems.push(new Array('Site web (français)','http://www.sylvainlafontaine.com/'));
                
  menuitems.push(new Array('-Blogues','http://paparazzi-codeur.sylvainlafontaine.com/'));
                
  menuitems.push(new Array('-+Access, ADP et SQL-Server','http://access-adp-sqlserver-francais.sylvainlafontaine.com/'));
                
  menuitems.push(new Array('-+Le Paparazzi~Codeur','http://paparazzi-codeur.sylvainlafontaine.com/'));
                
  menuitems.push(new Array('-La Transformée de Fourier','http://transformee-fourier.sylvainlafontaine.com/'));
                
  menuitems.push(new Array('-+Chapitre 1 - Les Séries de Fourier','http://draft.blogger.com/http//transformee-fourier.sylvainlafontaine.com/2009/11/chapitre-1-les-series-de-fourier.html'));
                
  menuitems.push(new Array('-+=A- Principe des Séries de Fourier','http://transformee-fourier.sylvainlafontaine.com/2009/11/chapitre-1-les-series-de-fourier.html#A- Principe des Séries de Fourier'));
                
  menuitems.push(new Array('-+=B- Les Séries de Fourier','http://transformee-fourier.sylvainlafontaine.com/2009/11/chapitre-1-les-series-de-fourier_29.html#B- Les Séries de Fourier'));
                
  menuitems.push(new Array('-+Chapitre 2 - La diffraction aux rayons-X','http://transformee-fourier.sylvainlafontaine.com/2009/11/chapitre-2-la-diffraction-aux-rayons-x.html'));
                
  menuitems.push(new Array('-+=A- Loi de Laue','http://transformee-fourier.sylvainlafontaine.com/2009/11/chapitre-2-la-diffraction-aux-rayons-x.html#Loi de Laue'));
                
  menuitems.push(new Array('-+=B- Les réseaux cristallins','http://transformee-fourier.sylvainlafontaine.com/2009/11/chapitre-2-la-diffraction-aux-rayons-x_29.html#B- Les réseaux cristallins'));

  menuitems.push(new Array('Web site (english)','http://english.sylvainlafontaine.com/'));
                
  menuitems.push(new Array('-Blogs','http://coding-paparazzi.sylvainlafontaine.com/'));
                
  menuitems.push(new Array('-+Access, ADP and SQL-Server','http://access-adp-sqlserver.sylvainlafontaine.com/'));
                
  menuitems.push(new Array('-+The Coding Paparazzi','http://coding-paparazzi.sylvainlafontaine.com/'));
                
  menuitems.push(new Array('-The Fourier Transform','http://fourier-transform.sylvainlafontaine.com/'));
                
  menuitems.push(new Array('-+Chapter 1 - The Fourier Series','http://fourier-transform.sylvainlafontaine.com/2009/11/chapter-1-fourier-series.html'));
                
  menuitems.push(new Array('-+=A- The Principle of Fourier Series','http://fourier-transform.sylvainlafontaine.com/2009/11/chapter-1-fourier-series.html#A- The Principle of Fourier Series'));
                
  menuitems.push(new Array('-+=B- The Fourier Series','http://fourier-transform.sylvainlafontaine.com/2009/11/chapter-1-fourier-series-section-b.html#B- The Fourier Series'));
                
  menuitems.push(new Array('-+Chapter 2 - The X-Ray Diffraction','http://fourier-transform.sylvainlafontaine.com/2009/11/chapter-2-x-ray-diffraction.html'));
                
  menuitems.push(new Array('-+=A- Laue\'s law','http://fourier-transform.sylvainlafontaine.com/2009/11/chapter-2-x-ray-diffraction.html#Laue'));
                
  menuitems.push(new Array('-+=B- Crystalline networks','http://fourier-transform.sylvainlafontaine.com/2009/11/chapter-2-x-ray-diffraction-section-b.html#Crystalline networks'));
                
  artDisplayTopMenu2 (menuitems);
}

function artDisplayTopMenu2(menuitems) {

    var i = 0;
    var subList = false;
    var subList2 = false;
    var subList3 = false;

    for (i=0; i &amp;lt; menuitems.length; i++) {
      var item = menuitems[i];
      var itemname = item[0];
      var itemlink = item[1];
      
      if ( ((itemname.indexOf(&amp;quot;=&amp;quot;) == 2) &amp;amp;&amp;amp; !subList3)
        || ((itemname.indexOf(&amp;quot;+&amp;quot;) == 1) &amp;amp;&amp;amp; !subList2)
        || ( (itemname.indexOf(&amp;quot;-&amp;quot;) == 0) &amp;amp;&amp;amp; !subList) ) {
          document.write('&amp;lt;ul&amp;gt;');

      } else if ( ((itemname.indexOf(&amp;quot;=&amp;quot;) != 2) &amp;amp;&amp;amp; subList3)
	|| ((itemname.indexOf(&amp;quot;+&amp;quot;) != 1) &amp;amp;&amp;amp; subList2)
                || ((itemname.indexOf(&amp;quot;-&amp;quot;) != 0) &amp;amp;&amp;amp; subList) ) {

        if ( (itemname.indexOf(&amp;quot;=&amp;quot;) != 2) &amp;amp;&amp;amp; subList3) {
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);
          subList3 = false;
        }

        if ( (itemname.indexOf(&amp;quot;+&amp;quot;) != 1) &amp;amp;&amp;amp; subList2) {
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);
          subList2 = false;
        }

        if ( (itemname.indexOf(&amp;quot;-&amp;quot;) != 0) &amp;amp;&amp;amp; subList) {
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);
          subList = false;
        }

        document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;quot;);

      } else if (i != 0) {
        document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;quot;);
      }
      
      document.write(&amp;quot;&amp;lt;li&amp;gt;&amp;quot;);

      if (itemname.indexOf(&amp;quot;-&amp;quot;) != 0) {
        if (window.location == itemlink) {
          document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot; class=&amp;quot;active&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;l&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;r&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;t&amp;quot;&amp;gt;'+itemname+'&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;');

        } else if(itemlink == &amp;quot;http://./&amp;quot;) {
          document.write('&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;l&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;r&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;t&amp;quot;&amp;gt;'+itemname+'&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;');

        } else {
          document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;l&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;r&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;t&amp;quot;&amp;gt;'+itemname+'&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;');
        }

      } else {

        if (itemname.indexOf(&amp;quot;=&amp;quot;) == 2) {
          document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot;&amp;gt;'+itemname.substr(3,itemname.length)+'&amp;lt;/a&amp;gt;'); 
          subList = true;
          subList2 = true;
          subList3 = true;

        } else if (itemname.indexOf(&amp;quot;+&amp;quot;) == 1) {
          document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot;&amp;gt;'+itemname.substr(2,itemname.length)+'&amp;lt;/a&amp;gt;');
          subList = true;
          subList2 = true;

        } else {
          document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot;&amp;gt;'+itemname.substr(1,itemname.length)+'&amp;lt;/a&amp;gt;');
          subList = true;
        }
      }

      if (i == (menuitems.length-1)) {
        if (subList3)
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);
           
        if (subList2)
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);

        if (subList)
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);

        document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;quot;);
      }
    }
}
// ]]&amp;gt;
&lt;/textarea&gt;&lt;/pre&gt;
&lt;/form&gt;

&lt;p&gt;As we are now replacing the whole menuitems array, we must not forget to also include the option &amp;quot;Home&amp;quot; at its beginning; unless you don't want it there, of course!&lt;/p&gt;

&lt;p&gt;However, if you try this code directly, it won't work at first as we have one last final adjustement to make: Blogger will not take the time to call the &lt;strong&gt;artDisplayTopMenu()&lt;/strong&gt; (the original or our own version) if it doesn't see any created item in the Top Menu; so we have to create a dummy one to act as a trigger.&amp;#160; As this is a dummy argument that will never make it to the client's browser, you can write anything for it:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_w76XuJflOGw/SyFiQh_pvSI/AAAAAAAAFQQ/Z5AVPHC1ZzU/s1600-h/captured_Image.png716.gif" target="_blank"&gt;&lt;img title="captured_Image.png[7]" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="516" alt="captured_Image.png[7]" src="http://lh5.ggpht.com/_w76XuJflOGw/SyFiRYPazuI/AAAAAAAAFQU/sz0sGkMokrw/captured_Image.png7_thumb19.gif?imgmax=800" width="512" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;You can see the an example of the result of this code on the demonstration site &amp;quot;&lt;a href="http://test2-sub-submenu-artisteer-blogger.blogspot.com/"&gt;Test2 - Sub-SubMenu with Artisteer&lt;/a&gt;&amp;quot;.&lt;/p&gt;

&lt;p&gt;When you have long menus or multiple blogs, it's much faster to manage them using this then by using the standard interface of Blogger (the &amp;quot;Configure Link List&amp;quot; dialog window).&lt;/p&gt;

&lt;p&gt;However, there is one small problem remaining: this code will be erased if you refresh your Blogger template using Artisteer; so it is advisable to always make a backup copy of your code somewhere. Artisteer will also make a backup copy of your older template in the directory &amp;quot;&lt;strong&gt;C:\Documents and Settings\***YourUserName***\Application Data\Artisteer\Artisteer2\Library\BloggerBackup/&lt;/strong&gt;&amp;quot; (for Windows XP); so you can always find a copy of your code there.&amp;#160; Notice that this an ordinary problem that you'll always have once you start customizing your templates.&lt;/p&gt;

&lt;p&gt;This concludes Part 2 of the article on the sub-sousMenu of Artisteer for Blogger. In Part 4 we will see a new way to write our list of options for the menu without even having to go through the form &amp;quot;Edit HTML&amp;quot; each time but first, we'll see in part 3 how to adjust the width of the boxes created for the menu by Artisteer so that they will automatically adapt their size to their content instead of having all the same width.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;Copyright © 2009-2010 &lt;a href="http://www.sylvainlafontaine.com/"&gt;&lt;strong style="color: #134753;"&gt;Sylvain Lafontaine&lt;/strong&gt;&lt;/a&gt;.&amp;nbsp; All rights reserved.&lt;br/&gt;
Web site : &lt;a href="http://coding-paparazzi.sylvainlafontaine.com"&gt;&lt;strong style="color: #134753;"&gt;coding-paparazzi.sylvainlafontaine.com&lt;/strong&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; 
Email : &lt;a href="mailto:sylvainlafontaine2009@yahoo.ca"&gt;&lt;strong style="color: #134753;"&gt;sylvainlafontaine2009@yahoo.ca&lt;/strong&gt;&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4597579859901368488-6491967371853893673?l=coding-paparazzi.sylvainlafontaine.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NZX496PXubCY9Doae9V1nx_4y_k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NZX496PXubCY9Doae9V1nx_4y_k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NZX496PXubCY9Doae9V1nx_4y_k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NZX496PXubCY9Doae9V1nx_4y_k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheCodingPaparazzi/~4/dysyVtk1o3g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://coding-paparazzi.sylvainlafontaine.com/feeds/6491967371853893673/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://coding-paparazzi.sylvainlafontaine.com/2009/12/sub-submenu-blogger-artisteer-part2.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/6491967371853893673?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/6491967371853893673?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TheCodingPaparazzi/~3/dysyVtk1o3g/sub-submenu-blogger-artisteer-part2.html" title="Sub-SubMenu for Blogger with Artisteer, part 2" /><author><name>Sylvain Lafontaine</name><uri>http://www.blogger.com/profile/08439067731828915631</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_w76XuJflOGw/S0EvrjQTAqI/AAAAAAAAFc8/MeCzPdBteeg/S220/Sylvain+-+thumbnail,+carre,+54x54px,+version+3.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_w76XuJflOGw/SyFiLF5D70I/AAAAAAAAFhY/c7F1HQtTKH0/s72-c/captured_Image.png_thumb%5B1%5D.gif?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://coding-paparazzi.sylvainlafontaine.com/2009/12/sub-submenu-blogger-artisteer-part2.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cMQXc8cSp7ImA9WxBQEE8.&quot;"><id>tag:blogger.com,1999:blog-4597579859901368488.post-6170262320461894908</id><published>2009-12-09T17:17:00.001-05:00</published><updated>2010-01-09T04:24:40.979-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-09T04:24:40.979-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Blogger" /><title>Quick and simple encoding of javascript ads (AdSense and others) for Blogger</title><content type="html">&lt;p&gt;A question that often comes back on sites about Blogger is how to encode (or &amp;quot;parse&amp;quot;) the four special characters &lt;strong&gt;&amp;quot; &amp;lt;&amp;gt; &amp;amp; &lt;/strong&gt;that will often be found in the JavaScript code for Ads like Google Adsense, AdBrite, Amazon, etc... in order to make them acceptable for the Blogger's XML storage tool. This article shows a new way easier and faster than the usual recommended way to accommodate these special characters for their storage in an XML document such as the one used with Blogger's XML templating tool.&lt;/p&gt; &lt;a name='more'&gt;&lt;/a&gt;&lt;!-- more --&gt;  &lt;p&gt;When you insert an announcement (Ad) in javascript in your Blogger template but that you leave aside the question of encoding the four characters &lt;strong&gt;&amp;quot;&amp;lt;&amp;gt; &amp;amp; &lt;/strong&gt;you can find yourself, in some cases, with an error message identical or similar to the following example:&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0px"&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;We were unable to save your template&lt;/strong&gt;&lt;/font&gt;       &lt;br /&gt;&amp;#160; &lt;br /&gt;&lt;strong&gt;Please correct the error below, and submit your template again.&lt;/strong&gt;       &lt;br /&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.&lt;/strong&gt;&lt;/font&gt;       &lt;br /&gt;&amp;#160; &lt;br /&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XML error message: XML document structures must start and end within the same entity.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;This will not always happen and will depend on where in the Blogger template you are trying to put the Ad and, of course, on the level and type of customization that you have already done with it.&amp;#160; You can find other examples of those error messages as well as additional information on this topic on &amp;quot;&lt;a href="http://tipstrik-makemoneyonline.blogspot.com/2009/02/parse-html-for-adsense-code-and-blogger.html"&gt;Parse HTML for Adsense Code and Blogger Posting&lt;/a&gt;&amp;quot;, &amp;quot;&lt;a href="http://www.mydigitallife.info/2007/09/21/trick-to-add-adsense-adbrite-and-other-javascript-ad-code-directly-to-blogger-html-template/"&gt;Trick to Add AdSense, AdBrite and Other JavaScript Ad Code Directly to Blogger HTML Template&lt;/a&gt;&amp;quot; and &amp;quot;&lt;a href="http://www.mydigitallife.info/2007/09/21/trick-to-add-adsense-adbrite-and-other-javascript-ad-code-directly-to-blogger-html-template/"&gt;Trick to Add AdSense, AdBrite and Other JavaScript Ad Code Directly to Blogger HTML Template&lt;/a&gt;&amp;quot;.&lt;/p&gt;  &lt;p&gt;These error occur because a Blogger templates is stored in the format of a XML document and therefore, the four special characters &lt;strong&gt;&lt;font color="#ff0000"&gt;&amp;quot;&amp;lt;&amp;gt; &amp;amp;&lt;/font&gt;&lt;/strong&gt; must usually be encoded (if they are present) as their HTML entities: &lt;font color="#ff8000"&gt;&lt;strong&gt;&amp;amp;quot;&lt;/strong&gt;&lt;/font&gt; , &lt;strong&gt;&lt;font color="#ff8000"&gt;&amp;amp;lt;&lt;/font&gt;&lt;/strong&gt; , &lt;strong&gt;&lt;font color="#ff8000"&gt;&amp;amp;gt;&lt;/font&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;font color="#ff8000"&gt;&amp;amp;amp;&lt;/font&gt;&lt;/strong&gt;.&amp;#160; This must be done weither or not they are used inside a piece of javascript code or in another location in the XML document; with one exception as explained below; this particular exception beeing used as the basis for the technique shown in this article. On some occasion, Blogger will do the conversion automatically for you - so you don't have to do it yourself - but this won't always happen and will depend on where you are trying to insert your javascript Ads.&lt;/p&gt;  &lt;p&gt;In those cases where Blogger won't do the conversion for you, you must then do it either manually or by using a site such &amp;quot;&lt;a href="http://www.blogcrowds.com/resources/parse_html.php"&gt;Escape HTML - Blogrowds Resources&lt;/a&gt;&amp;quot; that will translate those specials characters present in your javascript Ads into their HTML entities.&lt;/p&gt;  &lt;p&gt;Encoding these special characters individually works quite well but unfortunately, you can make mistakes if you do this operation manually or you must continually go on encoding site every time you want to make a modification to your Ads; something that will quickly become tedious if you want to change your ads regularly or to test different configurations.&lt;/p&gt;  &lt;p&gt;However, another, simpler solution exists than individually encoding these characters: this would be to use the global escaping sequence of XML &amp;lt;! [CDATA [... ]]&amp;gt; around the javascript code. If you install this sequence the JavaScript code, between the &amp;lt;script&amp;gt;...&amp;lt;/scripts&amp;gt; tags, it must itself be hidden from the view of the JavaScript parser by using one of the two javascript comments: &lt;strong&gt;&lt;span style="background-color: cyan"&gt;//&lt;/span&gt;&lt;/strong&gt; or &lt;font color="#ff8000"&gt;&lt;strong&gt;/*&lt;/strong&gt;&lt;/font&gt;...&lt;strong&gt;&lt;font color="#ff8000"&gt;*/ &lt;/font&gt;&lt;/strong&gt;:&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0px"&gt;&amp;lt;script language='javascript'&amp;gt;      &lt;br /&gt;&lt;span style="background-color: cyan"&gt;//&lt;/span&gt; &lt;span style="background-color: yellow"&gt;&amp;lt;![CDATA[        &lt;br /&gt;        &lt;br /&gt;&lt;/span&gt;&amp;#160;&amp;#160; ... piece of javascript code to be escaped.       &lt;br /&gt;      &lt;br /&gt;&lt;span style="background-color: cyan"&gt;//&lt;/span&gt; &lt;span style="background-color: yellow"&gt;]]&amp;gt;        &lt;br /&gt;&lt;/span&gt;&amp;lt;/script&amp;gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;But these ads are often composed of more than one single segments &amp;lt;script&amp;gt; ...&amp;lt;/ script&amp;gt;.&amp;#160; Furthermore, the attribute for designing the language inside these tags can itself use the double quote &lt;strong&gt;&amp;quot;&lt;/strong&gt; instead of the single quote; for example with « &lt;strong&gt;language=&amp;quot;javascript&amp;quot;&lt;/strong&gt; » or « &lt;strong&gt;type=&amp;quot;text/javascript&amp;quot;&lt;/strong&gt; » instead of « &lt;strong&gt;language='javascript'&lt;/strong&gt; ».&amp;#160; Having to change them every time will be as tedious and error-prone than the other two previous methods.&lt;/p&gt;  &lt;p&gt;Moreover, some of these affiliate programs prohibit to make any changes other than minor to the javascript code provided for their ads (reference: &lt;a href="http://tipstrik-makemoneyonline.blogspot.com/search/label/Blogger%20How%20to"&gt;Tips and Tutorials to Make Money Online: Blogger How to&lt;/a&gt; ). Although I personally consider the previous amendments as minor and thereby, remaining within the limits of the terms of use for these ads, some people may not agree or simply have some fear to put their AdSense account or any other account with a restricted set of rules at jeopardy.&lt;/p&gt;  &lt;p&gt;So the best solution would be to put the whole block - including the &amp;lt;script&amp;gt; tags themselves - inside the global escape sequence. In this way, no change at all whatsoever will be made to the provided javascript code for the ads. In fact, by doing this way, it will be even better than the usual way of encoding the individual characters &lt;strong&gt;&amp;quot;&amp;lt;&amp;gt; &amp;amp;&lt;/strong&gt; because absolutely no change will be made to the code at all; not even a simple encoding of some of the characters.&lt;/p&gt;  &lt;p&gt;To this end, a first attempt at a solution would be to simply try to write the sequence &amp;lt;! [CDATA [... ]]&amp;gt; directly around the block; as shown in the following example:&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;![CDATA[        &lt;br /&gt;        &lt;br /&gt;&lt;/span&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;!-- amazon_ad_tag = &amp;quot;lepapcod-20&amp;quot;; amazon_ad_width = &amp;quot;728&amp;quot;; amazon_ad_height = &amp;quot;90&amp;quot;;//--&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;script src=&lt;a href="http://www.assoc-amazon.com/s/ads.js"&gt;http://www.assoc-amazon.com/s/ads.js&lt;/a&gt; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;       &lt;br /&gt;      &lt;br /&gt;&lt;span style="background-color: yellow"&gt;]]&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Unfortunately, the &amp;lt;[CDATA [... ]]&amp;gt; sequence will be seen by the browser and because of that, will be displayed on the screen; something that we don't want to see.&amp;#160; A second attempt could be to try to enclose these codes inside HTML comments:&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;!-- &amp;lt;![CDATA[ --&amp;gt;        &lt;br /&gt;        &lt;br /&gt;&lt;/span&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;!-- amazon_ad_tag = &amp;quot;lepapcod-20&amp;quot;; amazon_ad_width = &amp;quot;728&amp;quot;; amazon_ad_height = &amp;quot;90&amp;quot;;//--&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;script src=&amp;quot;http://www.assoc-amazon.com/s/ads.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;       &lt;br /&gt;      &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;!-- ]]&amp;gt; --&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;But unfortunately (again!), the XML comments are identical to the HTML comments; so that in the previous example, the sequence &amp;lt;![CDATA[ ... ]]&amp;gt; will be interpreted as a XML comment by the Blogger XML template engine and will not be effective.&lt;/p&gt;  &lt;p&gt;Finally, the real solution is simply to use javascript comments instead of HTML comments (or not comment at all) to hide to the browser the &amp;lt;![CDATA[ ... ]]&amp;gt; sequence:&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;script language='javascript'&amp;gt;//&amp;lt;![CDATA[&amp;lt;/script&amp;gt;        &lt;br /&gt;        &lt;br /&gt;&lt;/span&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;!-- amazon_ad_tag = &amp;quot;lepapcod-20&amp;quot;; amazon_ad_width = &amp;quot;728&amp;quot;; amazon_ad_height = &amp;quot;90&amp;quot;;//--&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;script src=&amp;quot;http://www.assoc-amazon.com/s/ads.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;       &lt;br /&gt;      &lt;br /&gt;&lt;span style="background-color: yellow"&gt;&amp;lt;script&amp;#160; language='javascript'&amp;gt;//]]&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;In this example, both lines:&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0px"&gt;&amp;lt;script language='javascript'&amp;gt;//&amp;lt;![CDATA[&amp;lt;/script&amp;gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;and:&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0px"&gt;&amp;lt;script&amp;#160; language='javascript'&amp;gt;//]]&amp;gt;&amp;lt;/script&amp;gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;will be seen by the browser as two separate javascript(s); each containing only a single comment so they will not affect the final result displayed. Moreover, as these are two separate scripts, you can put anything between these two; including other javascript tags!&amp;#160; Furthemore, those those tags can now contain anything, including the use of the double quote around the languge attribute.&amp;#160; Thre is now absolutely no limit to what you can put inside this global escaping sequence and this is not limited to javascript code.&amp;#160; For example, you could use to include an IMPORT statement inside the Blogger template; something that I will put to use in another article about using MathML with Blogger.&lt;/p&gt;  &lt;p&gt;To facilitate reading the previous examples, I've put white spaces around the tags but of course, you can remove them if necessary.&lt;/p&gt;  &lt;p&gt;Write these two lines at the beginning and the end of your ad's block might seems a little more complicated at first but remember that you don't have to edit or retouch them in any way whatsoever after that. All you have to do aftward is a simple Copy&amp;amp;Paste of the provied javascript code for the ad; without any modification or parsing to do and this, no matter what special characters these piece of codes could contain.&lt;/p&gt;  &lt;p&gt;You can even, if you wish, put them in your favorite macros program to be pasted anywhere.&amp;#160; Ultimately, the maintenance of your ad units will be much easier and faster since you will not have to make any change anymore. All that will remain to do will be to remove a site such as &amp;quot;&lt;a href="http://www.blogcrowds.com/resources/parse_html.php"&gt;Escape HTML - Blogrowds Resources&lt;/a&gt;&amp;quot; from your list of favorite bookmarks!&lt;/p&gt;  &lt;p&gt;You can see the final result on the demonstration site &amp;quot;&lt;a href="http://escaping-javascript-ads.blogspot.com/"&gt;Quick escape of javascript Ads on Blogger&lt;/a&gt;&amp;quot; where I've put four Amazon ads at different locations in the Blogger template - I did not formatted so you can well see that I put them anywhere anyhow:&lt;/p&gt;  &lt;p&gt;&lt;a title="Site de démonstration &amp;quot;Quick escape of javascript Ads on Blogger&amp;quot;" href="http://escaping-javascript-ads.blogspot.com/" target="_blank"&gt;&lt;img title="captured_Image.png[6]" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="483" alt="captured_Image.png[6]" src="http://lh5.ggpht.com/_w76XuJflOGw/SyAiBatbegI/AAAAAAAAFgs/mZApjlJLtHQ/captured_Image.png6%5B2%5D.gif?imgmax=800" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; In this article, I used an ad from Amazon as an example instead of AdSense simply because changing the AdSense code in order to displayed it instead of running it - so that you can see the javascript code - goes against the Terms of Services (TOS) of AdSense; which are very strict. There is also the question of the limit of three AdSense ads by article that could have been a problem here.&lt;/p&gt;  &lt;p&gt;But nevertheless, this technique will works as well with AdSense ads and its use does not go against the AdSense's TOS because you bring no change at all to the code itself or the way it is displayed on the browser.&amp;#160; This technique will also works with all other types of javascript ads because it leaves completely unchanged the code and in all cases, the code returned to the browser will remains completely identical to the original code provided with the ad.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;Copyright © 2009-2010 &lt;a href="http://www.sylvainlafontaine.com/"&gt;&lt;strong style="color: #134753;"&gt;Sylvain Lafontaine&lt;/strong&gt;&lt;/a&gt;.&amp;nbsp; All rights reserved.&lt;br/&gt;
Web site : &lt;a href="http://coding-paparazzi.sylvainlafontaine.com"&gt;&lt;strong style="color: #134753;"&gt;coding-paparazzi.sylvainlafontaine.com&lt;/strong&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; 
Email : &lt;a href="mailto:sylvainlafontaine2009@yahoo.ca"&gt;&lt;strong style="color: #134753;"&gt;sylvainlafontaine2009@yahoo.ca&lt;/strong&gt;&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4597579859901368488-6170262320461894908?l=coding-paparazzi.sylvainlafontaine.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Uxd6uieNKbeNLYoIW3bfaxd3Lfc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Uxd6uieNKbeNLYoIW3bfaxd3Lfc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Uxd6uieNKbeNLYoIW3bfaxd3Lfc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Uxd6uieNKbeNLYoIW3bfaxd3Lfc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheCodingPaparazzi/~4/PMYO79lY3R8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://coding-paparazzi.sylvainlafontaine.com/feeds/6170262320461894908/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://coding-paparazzi.sylvainlafontaine.com/2009/12/quick-encoding-of-javascript-ads-for.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/6170262320461894908?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/6170262320461894908?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TheCodingPaparazzi/~3/PMYO79lY3R8/quick-encoding-of-javascript-ads-for.html" title="Quick and simple encoding of javascript ads (AdSense and others) for Blogger" /><author><name>Sylvain Lafontaine</name><uri>http://www.blogger.com/profile/08439067731828915631</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_w76XuJflOGw/S0EvrjQTAqI/AAAAAAAAFc8/MeCzPdBteeg/S220/Sylvain+-+thumbnail,+carre,+54x54px,+version+3.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_w76XuJflOGw/SyAiBatbegI/AAAAAAAAFgs/mZApjlJLtHQ/s72-c/captured_Image.png6%5B2%5D.gif?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://coding-paparazzi.sylvainlafontaine.com/2009/12/quick-encoding-of-javascript-ads-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4HQ3cycSp7ImA9WxBQEE8.&quot;"><id>tag:blogger.com,1999:blog-4597579859901368488.post-957392940958780893</id><published>2009-12-07T21:49:00.001-05:00</published><updated>2010-01-09T03:15:32.999-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-09T03:15:32.999-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Blogger" /><category scheme="http://www.blogger.com/atom/ns#" term="Artisteer" /><title>Sub-SubMenu for Blogger with Artisteer, part 1</title><content type="html">&lt;script type="text/javascript"&gt;

  var id; // Deliberately unassigned variable: nécessaire si on veut           // réouvrir la même fenêtre tout le temps.

function w (t) {
  var hw;
  // hw = window.open ("about:blank", id, "")
  hw = window.open ("about:blank", "", "")

  // Le formatage des lignes sera conservé mais les codes HTML pour
  // &amp; " &lt; &gt; seront conservés tels quels.
  hw.document.open ("text/plain");
  hw.document.clear;

  var t2 = t.replace(/&amp;lt;/g, "&lt;").replace(/&amp;gt;/g, "&gt;").replace(/&amp;quot;/g, "\"").replace(/&amp;amp;/g, "&amp;");

  hw.document.write (t2);
  hw.document.close();
  return false;
}
&lt;/script&gt;  &lt;p&gt;Currently, we can get only one level of submenu with the standard templates for Blogger created with Artisteer, version 2.3;&amp;#160; Hopefully, the possibility of having second and third levels (sub-subMenu and sub-sub-subMenu) will be made in a future release of Artisteer but now, we are reduced to the obligation of doing the required modifications to the template ourselves if we want those. This is the object of this article and it can be made pretty well as you can see from the following figure illustrating an example of sub-menus expanding on three levels: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_w76XuJflOGw/Sx2-uQIWjjI/AAAAAAAAFI8/p2ao7XWooME/s1600-h/captured_Image.png288.gif" target="_blank"&gt;&lt;img title="captured_Image.png[28]" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="294" alt="captured_Image.png[28]" src="http://lh5.ggpht.com/_w76XuJflOGw/Sx2-vOnXxZI/AAAAAAAAFJI/4rqqgLddMF4/captured_Image.png28_thumb11.gif?imgmax=800" width="500" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;a name='more'&gt;&lt;/a&gt;&lt;!-- more --&gt;  &lt;p&gt;This article is divided into three parts. The first part shows how to modify the JavaScript code in the template for getting second and third levels of sub-menus. The second part deals with more advanced changes to the code for making our job easier when we have to create very long menus, having tens or even hundred of sub-options; something that is not easy to manage with the standard interface of Blogger for editing the menu. Finally, the third party shows how to style the submenus so that their width is related to their content in in order to have a more pleasing look to the eye.&lt;/p&gt;  &lt;p&gt;Note that even if you're not interested in the menu interface for Blogger created by Artisteer; some of the techniques discussed in this three parts article could still be interesting for you to read.&lt;/p&gt;  &lt;p&gt;Before we can make the changes seen in this article, we must first be able to know how to make modifications to the template once it has been installed (or published) on Blogger. To do this, you must use the &amp;quot;Edit HTML&amp;quot; tab of the &amp;quot;Layout&amp;quot; option that you'll find in the settings of your blog from your Blogger's Dashboard. Most of this has already been discussed many times on the various blogs about customizing Blogger so I won't repeat the process here but if you need to have some references, you can start with &amp;quot;&lt;a href="http://www.google.com/support/blogger/bin/answer.py?hl=en&amp;amp;answer=46870"&gt;Can I edit the HTML of my blog's layout? - Blogger Help&lt;/a&gt;&amp;quot; and &amp;quot;&lt;a href="http://www.google.com/support/blogger/bin/answer.py?hl=en&amp;amp;answer=43708"&gt;Layout Guide - Blogger Help&lt;/a&gt;&amp;quot;.&lt;/p&gt;  &lt;p&gt;When someone wants to change the Blogger template code to include several levels of submenus, the first thing to think would probably be to simply edit the template code in order to include the various submenus in ordinary (without any javascript) HTML code; like we must already do for the standard HTML templates produced by Artisteer. For a quick reference on this standard procedure, see &lt;a href="http://myartisteer.com/cheat-sheet-part3.html"&gt;Artisteer Add-ons - Cheat Sheet: Part 3 - Navigation&lt;/a&gt;. Unfortunately, it's not easy to do the same thing on Blogger because the required code to edit is included in a not easily editable widget; as you can see from the following extract (&lt;em&gt;notice that in order to see this piece of code on your own template, you must check the option &amp;quot;&lt;strong&gt;Expand Widget Templates&lt;/strong&gt;&amp;quot;; as it's also shown below in the upper right par of the figure&lt;/em&gt;) :&lt;/p&gt;  &lt;p&gt;&lt;img title="captured_Image.png[30]" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="336" alt="captured_Image.png[30]" src="http://lh3.ggpht.com/_w76XuJflOGw/Sx2-wnvT8fI/AAAAAAAAFJU/WMaNc7D1hYs/captured_Image.png309.gif?imgmax=800" width="500" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;Also, writing and editing the long list of the required &amp;lt;ul&amp;gt; and &amp;lt;li&amp;gt; tags necessary to express the CSS menu of Artisteer is not an easy task and is very prone to errors; especially when the number of options reach many tens. In my opinion, the method that we'll see in this article is a better solution but of course, you must not forget about the possibility of simply adding your own custom HTML code; especially if you have it already ready at your hand.&lt;/p&gt;  &lt;p&gt;From the code illustrated in the previous figure, we can see that once the list of options for the menu has been inserted into the dynamic array &amp;quot;&lt;strong&gt;menuitems&lt;/strong&gt;&amp;quot;, the function &lt;strong&gt;artDisplayTopMenu&lt;/strong&gt;() is called. This is the function that will generates the HTML code required for displying the menu using the information provided in the passed array &amp;quot;menuitems&amp;quot; and evidently, is also the one that we must modify in order to allow for the display of second and third level of sub-menus.&amp;#160; You can find this function by searching for &amp;quot;artDisplayTopMenu&amp;quot; or simply for &amp;quot;artD&amp;quot; (use [Ctrl]+F to access the Find box) but for your convenience, I reproduce the original source code here :&lt;/p&gt; &lt;form name="form2"&gt;   &lt;p style="margin: 12px 0px 8px"&gt;&lt;button class="art-button" onclick="javascript:document.form2.text_area.focus(); document.form2.text_area.select();"&gt;Select the source code&lt;/button&gt;&amp;#160;&lt;button class="art-button" onclick="javascript:w(document.form2.text_area.innerHTML);"&gt;Open in a new window&lt;/button&gt;&lt;/p&gt;    &lt;pre style="margin: 0px 0px 12px"&gt;&lt;textarea id="text_area" style="border-right: gray 1px solid; border-top: gray 1px solid; border-left: gray 1px solid; width: 582px; border-bottom: gray 1px solid; height: 260px" name="text_area" wrap="off"&gt;function artDisplayTopMenu(menuitems){
    var i=0;
    var subList = false;
    var menu = new Array();
    for(i=0; i &amp;amp;lt; menuitems.length; i++){
      var item = menuitems[i];
      var itemname = item[0];
      var itemlink = item[1];
      
      if ( (itemname.indexOf(&amp;amp;quot;-&amp;amp;quot;) == 0) &amp;amp;amp;&amp;amp;amp; !subList) document.write(&amp;amp;quot;&amp;amp;lt;ul&amp;amp;gt;&amp;amp;quot;);
      else if ( (itemname.indexOf(&amp;amp;quot;-&amp;amp;quot;) != 0) &amp;amp;amp;&amp;amp;amp; subList) { document.write(&amp;amp;quot;&amp;amp;lt;/ul&amp;amp;gt;&amp;amp;lt;/li&amp;amp;gt;&amp;amp;quot;); subList = false; }
      else if (i != 0) document.write(&amp;amp;quot;&amp;amp;lt;/li&amp;amp;gt;&amp;amp;quot;);
      
      document.write(&amp;amp;quot;&amp;amp;lt;li&amp;amp;gt;&amp;amp;quot;);
      
      if (itemname.indexOf(&amp;amp;quot;-&amp;amp;quot;) != 0){
        if (window.location == itemlink) 
            document.write(&amp;amp;#39;&amp;amp;lt;a href=&amp;amp;quot;&amp;amp;#39;+itemlink+&amp;amp;#39;&amp;amp;quot; class=&amp;amp;quot;active&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;span class=&amp;amp;quot;l&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;span class=&amp;amp;quot;r&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;span class=&amp;amp;quot;t&amp;amp;quot;&amp;amp;gt;&amp;amp;#39;+itemname+&amp;amp;#39;&amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;/a&amp;amp;gt;&amp;amp;#39;);
        else if(itemlink == &amp;amp;quot;http://./&amp;amp;quot;)
            document.write(&amp;amp;#39;&amp;amp;lt;a href=&amp;amp;quot;#&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;span class=&amp;amp;quot;l&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;span class=&amp;amp;quot;r&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;span class=&amp;amp;quot;t&amp;amp;quot;&amp;amp;gt;&amp;amp;#39;+itemname+&amp;amp;#39;&amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;/a&amp;amp;gt;&amp;amp;#39;);
        else
            document.write(&amp;amp;#39;&amp;amp;lt;a href=&amp;amp;quot;&amp;amp;#39;+itemlink+&amp;amp;#39;&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;span class=&amp;amp;quot;l&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;span class=&amp;amp;quot;r&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;span class=&amp;amp;quot;t&amp;amp;quot;&amp;amp;gt;&amp;amp;#39;+itemname+&amp;amp;#39;&amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;/a&amp;amp;gt;&amp;amp;#39;);
      } else {
        document.write(&amp;amp;#39;&amp;amp;lt;a href=&amp;amp;quot;&amp;amp;#39;+itemlink+&amp;amp;#39;&amp;amp;quot;&amp;amp;gt;&amp;amp;#39;+itemname.substr(1,itemname.length)+&amp;amp;#39;&amp;amp;lt;/a&amp;amp;gt;&amp;amp;#39;);
        subList = true;
      }
      if (i==(menuitems.length-1)) document.write(&amp;amp;quot;&amp;amp;lt;/li&amp;amp;gt;&amp;amp;quot;);
    }
}
&lt;/textarea&gt;&lt;/pre&gt;
&lt;/form&gt;

&lt;p&gt;The first thing we notice is that all the four characters &amp;quot;&amp;lt;&amp;gt; &amp;amp; have been escaped (translated) into their equivalent HTML entities; which makes reading or changing the JavaScript code more difficult. A Blogger template is stored as a XML document; which means that these four characters must be obligatory be escaped. However, instead of escaping them individually, we could also chose to use the global XML escape sequence &amp;lt;![CDATA[ ... ]]&amp;gt;. As this special sequence must be used in a piece of JavaScript code, it must itself be escaped from the view of the JavaScript parser by using either // or /* ... */; which at the final gives us:&lt;/p&gt;

&lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.6em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.6em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;
  &lt;p style="margin: 0px"&gt;// &amp;lt;![CDATA[ 
    &lt;br /&gt;

    &lt;br /&gt;&amp;#160;&amp;#160; ... javascript code containing the following caracters: &amp;quot; &amp;lt; &amp;gt; &amp;amp; 

    &lt;br /&gt;

    &lt;br /&gt;// ]]&amp;gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;By using this special sequence, we can rewrite the code of the function in a much cleaner and lisible way:&lt;/p&gt;
&lt;form name="form3"&gt;
  &lt;p style="margin: 12px 0px 8px"&gt;&lt;button class="art-button" onclick="javascript:document.form3.text_area.focus(); document.form3.text_area.select();"&gt;Select the source code&lt;/button&gt;&amp;#160;&lt;button class="art-button" onclick="javascript:w(document.form3.text_area.innerHTML);"&gt;Open in a new window&lt;/button&gt;&lt;/p&gt;

  &lt;pre style="margin: 0px 0px 12px"&gt;&lt;textarea id="text_area" style="border-right: gray 1px solid; border-top: gray 1px solid; border-left: gray 1px solid; width: 582px; border-bottom: gray 1px solid; height: 260px" name="text_area" wrap="off"&gt;// &amp;lt;![CDATA[

function artDisplayTopMenu(menuitems){
    var i=0;
    var subList = false;
    var menu = new Array();
    for(i=0; i &amp;lt; menuitems.length; i++){
      var item = menuitems[i];
      var itemname = item[0];
      var itemlink = item[1];
      
      if ( (itemname.indexOf(&amp;quot;-&amp;quot;) == 0) &amp;amp;&amp;amp; !subList) document.write(&amp;quot;&amp;lt;ul&amp;gt;&amp;quot;);
      else if ( (itemname.indexOf(&amp;quot;-&amp;quot;) != 0) &amp;amp;&amp;amp; subList) { document.write(&amp;quot;&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;&amp;quot;); subList = false; }
      else if (i != 0) document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;quot;);
      
      document.write(&amp;quot;&amp;lt;li&amp;gt;&amp;quot;);
      
      if (itemname.indexOf(&amp;quot;-&amp;quot;) != 0){
        if (window.location == itemlink) 
            document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot; class=&amp;quot;active&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;l&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;r&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;t&amp;quot;&amp;gt;'+itemname+'&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;');
        else if(itemlink == &amp;quot;http://./&amp;quot;)
            document.write('&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;l&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;r&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;t&amp;quot;&amp;gt;'+itemname+'&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;');
        else
            document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;l&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;r&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;t&amp;quot;&amp;gt;'+itemname+'&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;');
      } else {
        document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot;&amp;gt;'+itemname.substr(1,itemname.length)+'&amp;lt;/a&amp;gt;');
        subList = true;
      }
      if (i==(menuitems.length-1)) document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;quot;);
    }
}
// ]]&amp;gt;
&lt;/textarea&gt;&lt;/pre&gt;
&lt;/form&gt;

&lt;p&gt;Note that the escaping sequence &amp;lt;![CDATA [ ... ]]&amp;gt; can be used for other purposes, such as for fast encoding of javascript ads (AdSense, AdBrite, Amazon, etc.., see the article &amp;quot;&lt;a href="http://coding-paparazzi.sylvainlafontaine.com/2009/12/quick-encoding-of-javascript-ads-for.html"&gt;Simple and fast encoding of javascript ads (AdSense and others) for Blogger&lt;/a&gt;&amp;quot;) or for inserting the XML statement &amp;lt;? IMPORT&amp;gt;, as discussed in another article on the use of MathML with Blogger.&lt;/p&gt;

&lt;p&gt;To create a sub-menu in Blogger using this function, we must place an hyphen (&amp;quot;-&amp;quot; or dash) at the beginning of the name of each sub-item of the menu's &amp;quot;Link List&amp;quot; configu/ation window:&lt;/p&gt;

&lt;p&gt;&lt;img title="captured_Image.png[34]" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="432" alt="captured_Image.png[34]" src="http://lh6.ggpht.com/_w76XuJflOGw/Sx2-xGdMEEI/AAAAAAAAFJg/InrxeK6y0JQ/captured_Image.png3416.gif?imgmax=800" width="500" border="0" /&gt; &lt;/p&gt;

&lt;p&gt;The new version that I made uses something similar: the second level requires a &amp;quot;-+&amp;quot; at the beginning of each option's name and the third level a &amp;quot;-+=&amp;quot;; as you can see in the below figure.&amp;#160; I've chosen these labels because they were making the code and the hierarchy of the menu easier to read and understand but of course, you could use anything else; provided that you adapt the code of the function.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_w76XuJflOGw/Sx2-x43cj8I/AAAAAAAAFJs/Bwk9H6ieVC0/s1600-h/captured_Image.png368.gif" target="_blank"&gt;&lt;img title="captured_Image.png[36]" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="333" alt="captured_Image.png[36]" src="http://lh6.ggpht.com/_w76XuJflOGw/Sx2-ypoWkHI/AAAAAAAAFJ4/207qP2jE-c4/captured_Image.png36_thumb12.gif?imgmax=800" width="500" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;And now, without any further delay, here's the revised version of the function artDisplayTopMenu() : &lt;/p&gt;
&lt;form name="form1"&gt;
  &lt;p style="margin: 12px 0px 8px"&gt;&lt;button class="art-button" onclick="javascript:document.form1.text_area.focus(); document.form1.text_area.select();"&gt;Select the source code&lt;/button&gt;&amp;#160;&lt;button class="art-button" onclick="javascript:w(document.form1.text_area.innerHTML);"&gt;Open in a new window&lt;/button&gt;&lt;/p&gt;

  &lt;pre style="margin: 0px 0px 12px"&gt;&lt;textarea id="text_area" style="border-right: gray 1px solid; border-top: gray 1px solid; border-left: gray 1px solid; width: 582px; border-bottom: gray 1px solid; height: 260px" name="text_area" wrap="off"&gt;// New version for artDisplayTopMenu(); allowing for
// second and third sub-menu levels.
// First level: option name must begin with a '-'
// Second level: begin with a '-+'
// Third level: begin with a '-+='

// Not HTML escaped so // &amp;lt;![CDATA[ ... // ]]&amp;gt; must be used:
// &amp;lt;![CDATA[

function artDisplayTopMenu(menuitems) {

    var i = 0;
    var subList = false;
    var subList2 = false;
    var subList3 = false;

    for (i=0; i &amp;lt; menuitems.length; i++) {
      var item = menuitems[i];
      var itemname = item[0];
      var itemlink = item[1];
      
      if ( ((itemname.indexOf(&amp;quot;=&amp;quot;) == 2) &amp;amp;&amp;amp; !subList3)
        || ((itemname.indexOf(&amp;quot;+&amp;quot;) == 1) &amp;amp;&amp;amp; !subList2)
        || ( (itemname.indexOf(&amp;quot;-&amp;quot;) == 0) &amp;amp;&amp;amp; !subList) ) {
          document.write('&amp;lt;ul&amp;gt;');

      } else if ( ((itemname.indexOf(&amp;quot;=&amp;quot;) != 2) &amp;amp;&amp;amp; subList3)
	|| ((itemname.indexOf(&amp;quot;+&amp;quot;) != 1) &amp;amp;&amp;amp; subList2)
                || ((itemname.indexOf(&amp;quot;-&amp;quot;) != 0) &amp;amp;&amp;amp; subList) ) {

        if ( (itemname.indexOf(&amp;quot;=&amp;quot;) != 2) &amp;amp;&amp;amp; subList3) {
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);
          subList3 = false;
        }

        if ( (itemname.indexOf(&amp;quot;+&amp;quot;) != 1) &amp;amp;&amp;amp; subList2) {
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);
          subList2 = false;
        }

        if ( (itemname.indexOf(&amp;quot;-&amp;quot;) != 0) &amp;amp;&amp;amp; subList) {
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);
          subList = false;
        }

        document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;quot;);

      } else if (i != 0) {
        document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;quot;);
      }
      
      document.write(&amp;quot;&amp;lt;li&amp;gt;&amp;quot;);

      if (itemname.indexOf(&amp;quot;-&amp;quot;) != 0) {
        if (window.location == itemlink) {
          document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot; class=&amp;quot;active&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;l&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;r&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;t&amp;quot;&amp;gt;'+itemname+'&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;');

        } else if(itemlink == &amp;quot;http://./&amp;quot;) {
          document.write('&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;l&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;r&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;t&amp;quot;&amp;gt;'+itemname+'&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;');

        } else {
          document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;l&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;r&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;t&amp;quot;&amp;gt;'+itemname+'&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;');
        }

      } else {

        if (itemname.indexOf(&amp;quot;=&amp;quot;) == 2) {
          document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot;&amp;gt;'+itemname.substr(3,itemname.length)+'&amp;lt;/a&amp;gt;'); 
          subList = true;
          subList2 = true;
          subList3 = true;

        } else if (itemname.indexOf(&amp;quot;+&amp;quot;) == 1) {
          document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot;&amp;gt;'+itemname.substr(2,itemname.length)+'&amp;lt;/a&amp;gt;');
          subList = true;
          subList2 = true;

        } else {
          document.write('&amp;lt;a href=&amp;quot;'+itemlink+'&amp;quot;&amp;gt;'+itemname.substr(1,itemname.length)+'&amp;lt;/a&amp;gt;');
          subList = true;
        }
      }

      if (i == (menuitems.length-1)) {
        if (subList3)
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);
           
        if (subList2)
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);

        if (subList)
          document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;);

        document.write(&amp;quot;&amp;lt;/li&amp;gt;&amp;quot;);
      }
    }
}
// ]]&amp;gt;
&lt;/textarea&gt;&lt;/pre&gt;
&lt;/form&gt;

&lt;p&gt;You can see and test the final result by going at the following blog that I've setup for testing purpose: &lt;a href="http://translate.googleusercontent.com/translate_c?hl=en&amp;amp;langpair=fr%7Cen&amp;amp;u=http://test-sub-submenu-artisteer-blogger.blogspot.com/&amp;amp;rurl=translate.google.com&amp;amp;twu=1&amp;amp;client=tmpg&amp;amp;usg=ALkJrhhW0FOUWAlyEiXPo3Xqn_gjBc0UKg"&gt;Sub-SubMenu for Blogger with Artisteer&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This concludes Part 1 of this article. In parts 2 and 3, we will elaborate on this feature by first replacing the need to use the dialog window &amp;quot;Link List&amp;quot; in order to manage the menu's options menu (replacing this dialog window is very useful because it's far from beeing to be the best in the world to use when you have dozens of options to adjust) and second, we will see in the last part how to adjust the widths of the boxes in order to adapt them to their content.&lt;/p&gt;

&lt;p&gt;A final word of caution: this is custom modification to the template, so if you republish your template from Artisteer, you'll have to remake this modification to your template again.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;Copyright © 2009-2010 &lt;a href="http://www.sylvainlafontaine.com/"&gt;&lt;strong style="color: #134753;"&gt;Sylvain Lafontaine&lt;/strong&gt;&lt;/a&gt;.&amp;nbsp; All rights reserved.&lt;br/&gt;
Web site : &lt;a href="http://coding-paparazzi.sylvainlafontaine.com"&gt;&lt;strong style="color: #134753;"&gt;coding-paparazzi.sylvainlafontaine.com&lt;/strong&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; 
Email : &lt;a href="mailto:sylvainlafontaine2009@yahoo.ca"&gt;&lt;strong style="color: #134753;"&gt;sylvainlafontaine2009@yahoo.ca&lt;/strong&gt;&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4597579859901368488-957392940958780893?l=coding-paparazzi.sylvainlafontaine.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ZGB4ehnM9eJ00a9r_EmPfnyVy9g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZGB4ehnM9eJ00a9r_EmPfnyVy9g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ZGB4ehnM9eJ00a9r_EmPfnyVy9g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZGB4ehnM9eJ00a9r_EmPfnyVy9g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheCodingPaparazzi/~4/CvNc2pj3_9s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://coding-paparazzi.sylvainlafontaine.com/feeds/957392940958780893/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://coding-paparazzi.sylvainlafontaine.com/2009/12/sub-submenu-for-blogger-with-artisteer.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/957392940958780893?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/957392940958780893?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TheCodingPaparazzi/~3/CvNc2pj3_9s/sub-submenu-for-blogger-with-artisteer.html" title="Sub-SubMenu for Blogger with Artisteer, part 1" /><author><name>Sylvain Lafontaine</name><uri>http://www.blogger.com/profile/08439067731828915631</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_w76XuJflOGw/S0EvrjQTAqI/AAAAAAAAFc8/MeCzPdBteeg/S220/Sylvain+-+thumbnail,+carre,+54x54px,+version+3.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_w76XuJflOGw/Sx2-vOnXxZI/AAAAAAAAFJI/4rqqgLddMF4/s72-c/captured_Image.png28_thumb11.gif?imgmax=800" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://coding-paparazzi.sylvainlafontaine.com/2009/12/sub-submenu-for-blogger-with-artisteer.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYAR3o4eyp7ImA9WxBQEE8.&quot;"><id>tag:blogger.com,1999:blog-4597579859901368488.post-3174898142251599668</id><published>2009-11-22T22:11:00.001-05:00</published><updated>2010-01-09T03:02:26.433-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-09T03:02:26.433-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Blogger" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows Live Writer" /><category scheme="http://www.blogger.com/atom/ns#" term="Picasa" /><title>Windows Live Writer, Blogger and Picasa albums</title><content type="html">&lt;p&gt;When you use Windows Live Writer (WLW) with Blogger, WLW will default all the pictures you download to a single Picasa album. We will see in this article how to configure WLW so that the images for each article will be published into separate albums.&lt;/p&gt; &lt;a name='more'&gt;&lt;/a&gt;&lt;!-- more --&gt;  &lt;p&gt;&lt;u&gt;&lt;strong&gt;INTRODUCTION&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;At this moment, I have only first article published (&lt;a href="http://coding-paparazzi.sylvainlafontaine.com/2009/11/title-menu-on-two-lines-for-joomla.html"&gt;Coding Paparazzi - Title menu on two lines for Joomla &amp;amp; Artisteer&lt;/a&gt;) and I'm already buried beneath the images. There are of course all these screenshots I took here and there for what to be my first article as well as for the followings but there is also a place where the images have spread like hot cakes and this place is called Picasa. Although that this first article that I wrote - this one being the second - does not contain more than fifteen images, I find myself with more than one hundred images in the Picasa album created by WLW:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_w76XuJflOGw/Swpj5lQ4z7I/AAAAAAAADbc/BSBMSdEO5d4/s1600-h/tmp9C%5B5%5D.png"&gt;&lt;img title="tmp9C" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="322" alt="tmp9C" src="http://lh5.ggpht.com/_w76XuJflOGw/Swn9QDKTuZI/AAAAAAAADbg/h7Ft-Y4hVGo/tmp9C_thumb%5B4%5D.png?imgmax=800" width="500" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And as you can see, many of these images are duplicates and all this, with only one single article! I can hardly imagine what it would when I will a few dozen articles - if ever I go that far, of course! I don't know about you but I guess that if you reading this article, it's probably because you are yourself in exactly the same situation. Even if we can erase those images that have become redundant and move others into new albums without risk of breaking the HTML links of the blog (the links created by WLW don't use the album names, only their ID), this is obviously a task work we would could spare ourself of, without counting the risk of accidentally erasing images that are still useful.&lt;/p&gt;  &lt;p&gt;Moreover, the maximum number of images per album in Picasa seems to be 500. As the links posted by WLW use the ID and not the Picasa album, simply renaming the album &amp;quot;Windos Live Writer&amp;quot; under another name - like &amp;quot;Windows Live Writer 01&amp;quot; for example - will be sufficient to restart a new sequence of 500 but obviously this is not is an ideal solution.&amp;#160; (Reference: &amp;quot;&lt;a href="http://revitize.blogspot.com/2008/10/windows-live-writer-upload-image-error.html"&gt;Revitize - WLW upload image error&lt;/a&gt;&amp;quot;, &amp;quot;&lt;a href="http://groups.google.com/group/blogger-help-howdoi/browse_thread/thread/698214f329c26d5/ed486209e012ad3e?lnk=gst&amp;amp;q=image+WLW#ed486209e012ad3e"&gt;Blogger.com Issue | Google Groups&lt;/a&gt;&amp;quot;). We could of course upload these images separately and then link them manually one by one or we could use something like the Picasa plugin for WLW (&lt;a href="http://gallery.live.com/liveItemDetail.aspx?li=92358e47-abe4-4a6a-8526-c09dee0450b9"&gt;Windows Live Gallery - Picasa Image Plugin&lt;/a&gt;) but again, this requires additional time and furthermore, will prevent us from the image manipulation tools of WLW; which are precisely one of its strengths.    &lt;br /&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;METHOD&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When we publish our pictures to another service than Picasa, FTP for example, WLW has no problem to separate them by article into different repertories; it has therefore the ability to do so already builtin. In searching the Internet for a solution to this problem, I came across the following articles which refer to the registry key &amp;quot;&lt;strong&gt;fileUploadNameFormat&lt;/strong&gt;&amp;quot;:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://revitize.blogspot.com/2008/10/windows-live-writer-upload-image-error.html"&gt;Revitize - Another Revit Blog: Windows Live Writer upload image error&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blog.geoffreyemery.com/post/Windows-Live-Writer-Image-Posting-Error.aspx"&gt;Windows Live Writer Image Posting Error&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://social.microsoft.com/Forums/en-US/writerbeta/thread/2efe5d28-2e23-4162-a7bc-0ae631290340"&gt;Picture upload fails due to missing &amp;quot;/&amp;quot; in url&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.zuckervati.com/blogzucker/archives/2008/04/"&gt;ZuckerBlog: April 2008 Archives &amp;quot;Editing file upload locations with Live Writer&amp;quot;&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;By adding this fileUploadNameFormat key in the registry below the branch &lt;strong&gt;HKLM \ Software \ Microsoft \ Windows Live \ Writer \ Weblogs \ {blog-id} \ UserOptionOverrides \&lt;/strong&gt; and where {log-id} is the blog's GUID as it has been registered under WLW, it is possible to redefine the default behavior of WLW when it uploads new images to Picasa. If you have multiple blogs, you will obviously have several {log-id} in the registry but by browsing the list, you can easily find the one that you are interested into by observing the properties at the right:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_w76XuJflOGw/Swn9RE0XItI/AAAAAAAADbo/sX6Xs0MtTpI/s1600-h/tmp5A4%5B21%5D.png"&gt;&lt;img title="tmp5A4" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="313" alt="tmp5A4" src="http://lh3.ggpht.com/_w76XuJflOGw/Swn9SZFk9DI/AAAAAAAADbw/-4XdG9rL4nc/tmp5A4_thumb%5B21%5D.png?imgmax=800" width="550" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;By looking at the BlogName property on the right of the above picture, you can see that the key {11ff...} is associated with the blog named &amp;quot;blogger - Sauvegarde - Sylvain Lafontaine (11)&amp;quot;. In the same way, the HomePageUrl property give us its home page.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Quick little trick&lt;/strong&gt;: when you have multiple blogs enregistred with WLW, it is convenient to add at the end of the name of each blog the first letters of its GUID; like you can see below.&amp;#160; This way, you can find their associated registry quickly. This is useful not only for redefining the default name of the Picasa albums but also for other things such as fixing the theme preview in WLW; which will be the subject of a forthcoming article.&lt;/p&gt;  &lt;p&gt;&lt;img title="captured_Image.png" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="245" alt="captured_Image.png" src="http://lh5.ggpht.com/_w76XuJflOGw/Swn9S4SsB9I/AAAAAAAADb0/0WPIHqIfM_g/captured_Image.png%5B7%5D.png?imgmax=800" width="459" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;To return to the new registry key to add, it must be of type String, with the exact name &lt;strong&gt;fileUploadNameFormat&lt;/strong&gt; (note the distinction between uppercase and lowercase as it is important!) and it must be created under the key &lt;strong&gt;UserOptionOverrides&lt;/strong&gt; of the corresponding blog; as it is illustrated below. In these screenshots, the key fileUploadNameFormat has already been created so you can see exactly where it should be made but of course, you won't see it on your machine until you have created it.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_w76XuJflOGw/Swn9Tu1FxSI/AAAAAAAADb4/N3Km-H9ufCc/s1600-h/tmp5A8%5B3%5D.png"&gt;&lt;img title="tmp5A8" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="298" alt="tmp5A8" src="http://lh6.ggpht.com/_w76XuJflOGw/Swn9U3nxd2I/AAAAAAAADcI/ujtaxaCnZAA/tmp5A8_thumb%5B2%5D.png?imgmax=800" width="550" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_w76XuJflOGw/Swn9VfKoA_I/AAAAAAAADcQ/8ucmXHcojxA/s1600-h/tmp5A6%5B3%5D.png"&gt;&lt;img title="tmp5A6" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="298" alt="tmp5A6" src="http://lh6.ggpht.com/_w76XuJflOGw/Swn9WasXqWI/AAAAAAAADcY/UtSCRjj3Wn8/tmp5A6_thumb%5B3%5D.png?imgmax=800" width="550" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;img title="tmp63C" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="206" alt="tmp63C" src="http://lh6.ggpht.com/_w76XuJflOGw/Swn9WwS9i9I/AAAAAAAADcc/SzjLVv64lb8/tmp63C%5B5%5D.png?imgmax=800" width="510" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;You can use the following tokens to define the name of the new albums:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;{PostTitle} &lt;/li&gt;    &lt;li&gt;{PostRandomizer} &lt;/li&gt;    &lt;li&gt;{Randomizer} &lt;/li&gt;    &lt;li&gt;{FileName} &lt;/li&gt;    &lt;li&gt;{AsciiFileName} &lt;/li&gt;    &lt;li&gt;{AsciiFileNameWithoutExtension} &lt;/li&gt;    &lt;li&gt;{FileExtension} &lt;/li&gt;    &lt;li&gt;{WindowsLiveWriter} &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This property must be of type String &lt;em&gt;&lt;strong&gt;and it must end with a &amp;quot;/&amp;quot;&lt;/strong&gt;&lt;/em&gt; as illustrated above&lt;strong&gt;&lt;em&gt;.&lt;/em&gt;&lt;/strong&gt; Excerpt for the tokens, all the rest of the string will be transcribed verbatim to the name of the new album. You can use special characters like blank spaces, underscores, hyphens or even other &amp;quot;/&amp;quot;.&amp;#160; The two most interesting tokens to use are &lt;strong&gt;{PostTitle}&lt;/strong&gt; and &lt;strong&gt;{PostRandomizer}&lt;/strong&gt;.&amp;#160; With the others, you may find yourself with a photo album created for each image. Here is an example of what I use personally:&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.5em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.5em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0em"&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;Brouillons - {PostTitle} {PostRandomizer}/&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;quot;Brouillons&amp;quot; here is for designating my private blog &amp;quot;Brouillons&amp;quot; and you can see the final result in Picasa; where a new album with the name &amp;quot;Brouillon - WLWBloggerPicasaetlesAlbums 5C20&amp;quot; (the original title was in french) has been automatically created for this article:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_w76XuJflOGw/Swn9X4B4B_I/AAAAAAAADco/U6mHnleiGQg/s1600-h/tmp544%5B8%5D.png"&gt;&lt;img title="tmp544" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="327" alt="tmp544" src="http://lh6.ggpht.com/_w76XuJflOGw/Swn9ZRYH9rI/AAAAAAAADcs/dZJiiqk7Y2M/tmp544_thumb%5B7%5D.png?imgmax=800" width="500" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Obviously, the name &amp;quot;Brouillon - WLWBloggerPicasaetlesAlbums 5C20&amp;quot; is not the prettiest and the title has been stripped from its blank spaces and other special characters such as the comma ((the original title was in french and it was &amp;quot;WLW, Blogger, Picasa et les Albums&amp;quot;) but nothing prevents you from renaming it to your liking after that. Remember that with the type of link created by WLW to Blogger, the name of the album which is a linked image does not matter and you can rename these albums or move an image from one album to another with no impact on the blog itself and that the main point here is that each article get its own album in Picasa when published by WLW.&lt;/p&gt;  &lt;p&gt;Also, when you change the key &amp;quot;fileUploadNameFormat&amp;quot;, it is not necessary to restart WLW each time before testing it. By adding a new image, so you can quickly make several tests to see what you like best. For those who prefer not to forage in the registries base, there are two alternatives for creating or changing the registry key &amp;quot;fileUploadNameFormat&amp;quot;. The first is to use a custom configuration file &lt;strong&gt;WLWManifest.XML&lt;/strong&gt; to redefine the default properties of a blog to WLW. This technique will be the subject of a separate article as the file wlwmanifest.xml can be used for many other purposes.&lt;/p&gt;  &lt;p&gt;The third method is to use the &lt;strong&gt;Writer Tweak Helper&lt;/strong&gt; program by Joe Cheng, available here: &lt;a href="http://www.joecheng.com/code/WriterTweakHelper.exe"&gt;WriterTweakHelper.exe&lt;/a&gt;. Download and run this program (it does not require to be installed but .NET is required) and you can then add, modify or delete any properties of the branch UserOptionsOverrides for each of your blogs without having to open the registries base:&lt;/p&gt;  &lt;p&gt;&lt;img title="tmp576" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="424" alt="tmp576" src="http://lh6.ggpht.com/_w76XuJflOGw/Swn9Z8UletI/AAAAAAAADc4/LiGjkJt0m1E/tmp576%5B4%5D.png?imgmax=800" width="403" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;LAST TIP&lt;/u&gt;&lt;/strong&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Finally, a little trick: When you create a new blog, it is easy to forget to set the registry key for name the Picasa albums. If you already have an album &amp;quot;Windows Live Writer, you will then end up with your new images in this album, something that can be annoying if it contains several hundred of images. So even if you intend not to use this album anymore and to group your pictures by article, it will still be useful to change the name of the album &amp;quot;Windows Live Writer&amp;quot; to something else like &amp;quot;Windows Live Writer 01&amp;quot;. That way, if you forget to set the key when you create a new blog on Blogger, your images will still be uploaded to a new album - &amp;quot;Windows Live Writer&amp;quot; - instead of the old one.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;Copyright © 2009-2010 &lt;a href="http://www.sylvainlafontaine.com/"&gt;&lt;strong style="color: #134753;"&gt;Sylvain Lafontaine&lt;/strong&gt;&lt;/a&gt;.&amp;nbsp; All rights reserved.&lt;br/&gt;
Web site : &lt;a href="http://coding-paparazzi.sylvainlafontaine.com"&gt;&lt;strong style="color: #134753;"&gt;coding-paparazzi.sylvainlafontaine.com&lt;/strong&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; 
Email : &lt;a href="mailto:sylvainlafontaine2009@yahoo.ca"&gt;&lt;strong style="color: #134753;"&gt;sylvainlafontaine2009@yahoo.ca&lt;/strong&gt;&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4597579859901368488-3174898142251599668?l=coding-paparazzi.sylvainlafontaine.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AqLJLlU_hJBBdkMQIvwAHYlSVZw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AqLJLlU_hJBBdkMQIvwAHYlSVZw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AqLJLlU_hJBBdkMQIvwAHYlSVZw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AqLJLlU_hJBBdkMQIvwAHYlSVZw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheCodingPaparazzi/~4/2g94bEDoPSw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://coding-paparazzi.sylvainlafontaine.com/feeds/3174898142251599668/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://coding-paparazzi.sylvainlafontaine.com/2009/11/windows-live-writer-blogger-and-picasa.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/3174898142251599668?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/3174898142251599668?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TheCodingPaparazzi/~3/2g94bEDoPSw/windows-live-writer-blogger-and-picasa.html" title="Windows Live Writer, Blogger and Picasa albums" /><author><name>Sylvain Lafontaine</name><uri>http://www.blogger.com/profile/08439067731828915631</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_w76XuJflOGw/S0EvrjQTAqI/AAAAAAAAFc8/MeCzPdBteeg/S220/Sylvain+-+thumbnail,+carre,+54x54px,+version+3.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_w76XuJflOGw/Swn9QDKTuZI/AAAAAAAADbg/h7Ft-Y4hVGo/s72-c/tmp9C_thumb%5B4%5D.png?imgmax=800" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://coding-paparazzi.sylvainlafontaine.com/2009/11/windows-live-writer-blogger-and-picasa.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMDRH48eyp7ImA9WxBQEE8.&quot;"><id>tag:blogger.com,1999:blog-4597579859901368488.post-8786877689734281955</id><published>2009-11-15T06:01:00.001-05:00</published><updated>2010-01-09T02:51:15.073-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-09T02:51:15.073-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Joomla" /><category scheme="http://www.blogger.com/atom/ns#" term="Artisteer" /><title>Joomla navigational menu's titles on two lines with an Artisteer template</title><content type="html">&lt;p&gt;In this article, we see a method to display the navigation menu Joomla on two or more lines, using for this a template from Artisteer as the basic example:&lt;/p&gt;  &lt;p&gt;&lt;img title="tmp4F1" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="77" alt="tmp4F1" src="http://lh6.ggpht.com/_w76XuJflOGw/Sv6Ir-fURTI/AAAAAAAACrc/792rfbP1YNY/tmp4F118.png?imgmax=800" width="294" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;Although illustrated with an Artisteer template, this method should also apply or be adapted very well for other types of template.    &lt;br /&gt;&amp;#160;&lt;/p&gt;  &lt;p style="border-top: gray 1px dotted; padding-top: 4px" align="left"&gt;ADDENDUM dated January 6, 2010:&lt;/p&gt;  &lt;p style="padding-bottom: 4px; border-bottom: gray 1px dotted" align="left"&gt;The HTML code described in this article uses the insertion of a block &amp;lt;div&amp;gt; within an area &amp;lt;span&amp;gt;.&amp;#160; Although this seems to work properly with both Firefox and Internet Explorer, further study has allowed me to conclude that a better approach would be to use another &amp;lt;span&amp;gt; instead of the &amp;lt;div&amp;gt; but by attaching to it the style &amp;quot;display: inline-block&amp;quot;.&amp;#160; This second method will be the object of an upcoming article.&lt;/p&gt; &lt;a name='more'&gt;&lt;/a&gt;&lt;!-- more --&gt;  &lt;p&gt;Yes, after much procrastination, I finally decided to start my first blog and for my very first article, I chose a recurring problem among users of Joomla and Artisteer: how to get a title in the Menu navigation to appear on more than a single line. As this is my very first blog, you'll excuse me if you find that throughout this article the writing and the formating are less than stellar.&lt;/p&gt;  &lt;p&gt;The following figure show us the starting point, with an expansion of the tab we are interested in below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_w76XuJflOGw/SwSdi9oAeqI/AAAAAAAACyE/wy_zPaKoMbs/s1600-h/tmp4C3%5B1%5D.png"&gt;&lt;img title="tmp4C3" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="149" alt="tmp4C3" src="http://lh3.ggpht.com/_w76XuJflOGw/Sv6IqWAHdBI/AAAAAAAACyI/vol7CchbTr0/tmp4C3_thumb.png?imgmax=800" width="550" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;img title="tmp4F0" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="56" alt="tmp4F0" src="http://lh5.ggpht.com/_w76XuJflOGw/Sv_cRs7jgHI/AAAAAAAACtM/FZ0EZICpiKc/tmp4F0%5B16%5D.png?imgmax=800" width="295" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;And this is the result that we want to obtain:&lt;/p&gt;  &lt;p&gt;&lt;img title="tmp4B7" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="149" alt="tmp4B7" src="http://lh5.ggpht.com/_w76XuJflOGw/Sv6IrmPQHgI/AAAAAAAACpE/Drj1a60YXzs/tmp4B7%5B12%5D.png?imgmax=800" width="550" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;img title="tmp4F1" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="77" alt="tmp4F1" src="http://lh6.ggpht.com/_w76XuJflOGw/Sv6Ir-fURTI/AAAAAAAACrc/792rfbP1YNY/tmp4F118.png?imgmax=800" width="294" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;Notice that the menu title &amp;quot;&lt;strong&gt;Sylvain Lafontaine.com&lt;/strong&gt;&amp;quot; is now written on two lines in height and is well centered in the middle of the tab. Although it may seem at first glance easy to accomplish, the solution to this problem is more complicated than it seems. The first thing that most people will probably try to do would be to simply add the XHTML tag &amp;quot;&lt;strong&gt;&amp;lt;br/&amp;gt;&lt;/strong&gt;&amp;quot; (or its HTML equivalent&amp;#160; &amp;quot;&lt;strong&gt;&amp;lt;br&amp;gt;&lt;/strong&gt;&amp;quot;) directly in the middle of the title of the menu in the Joomla configuration:&lt;/p&gt;  &lt;p&gt;&lt;img title="tmp985" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="195" alt="tmp985" src="http://lh6.ggpht.com/_w76XuJflOGw/Sv-18Z-RKRI/AAAAAAAACrk/3orATQL3sw0/tmp9857.png?imgmax=800" width="391" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;Detail for the title:&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.5em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.5em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0em"&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;Sylvain&lt;font color="#ff0000"&gt;&amp;lt;br /&amp;gt;&lt;/font&gt;Lafontaine.com&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Unfortunately, the result that we get is not what we were expecting:&lt;/p&gt;  &lt;p&gt;&lt;img title="tmp4C4" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="62" alt="tmp4C4" src="http://lh3.ggpht.com/_w76XuJflOGw/Sv6IsPXI5nI/AAAAAAAACro/3KBzzWPXDhw/tmp4C4%5B1%5D.png?imgmax=800" width="236" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;Instead of causing a line break, the &lt;strong&gt;&amp;lt;br /&amp;gt;&lt;/strong&gt; tag is simply displayed in the browser! That would have worked with Joomla 1.0 but for Joomla 1.5, the HTML tags are no longer interpreted by Joomla and instead are rendered as such in the browser; hence the visible display of the &lt;strong&gt;&amp;lt;br /&amp;gt;&lt;/strong&gt; tag in the above figure. Note that we would have obtained exactly the same result here even if we would have used the HTML tag &lt;strong&gt;&amp;lt;br&amp;gt;&lt;/strong&gt; instead of the XHTML tag &lt;strong&gt;&amp;lt;br /&amp;gt;.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;To solve this problem of displaying the tag with Joomla, we must use a Joomla plugin that will allow us to directly insert the tag &lt;strong&gt;&amp;lt;br&amp;gt;&lt;/strong&gt; into the HTML code created by Joomla.&amp;#160; The plugin that I'm suggesting is &lt;a href="http://translate.googleusercontent.com/translate_c?hl=en&amp;amp;sl=fr&amp;amp;tl=en&amp;amp;u=http://extensions.joomla.org/extensions/3326/details&amp;amp;rurl=translate.google.com&amp;amp;usg=ALkJrhi7yqMJvB5gQtcrtVhy0rJzXxXQAQ"&gt;yvBBCode&lt;/a&gt; but you'll get the same result if you use any other plugin. This plugin allows us to replace BB codes with our own HTML markup. BB codes are special codes enclosed in square brackets &lt;strong&gt;[]&lt;/strong&gt; - like &lt;strong&gt;[br]&lt;/strong&gt; for example - that we can insert into any Joomla text&amp;#160; and that will get converted into HTML markup by the yvBBCode pluging when the page is served by the web server (Joomla). For example, the code &amp;quot;&lt;strong&gt;[br]&lt;/strong&gt;&amp;quot; will be transformed into &amp;quot;&lt;strong&gt;&amp;lt;br /&amp;gt;&lt;/strong&gt;&amp;quot; (less the quotes).&lt;/p&gt;  &lt;p&gt;Moreover, with the yvBBCode plugin, we can define our own BB codes - allowing us to display any HTML code that we want - but unfortunately, we cannot define them directly from the Joomla admin interface and instead, we must change the source code of the &lt;a href="http://extensions.joomla.org/extensions/3326/details" target="_blank"&gt;yvBBCode&lt;/a&gt; plugin. We shall see later how to perform this change. The most recent version of yvBBCode already contains the BB code required for inserting the tag &lt;strong&gt;&amp;lt;br/&amp;gt;,&lt;/strong&gt; so that when we are finished installing the yvBBCode plugin on the Joomla site, we can directly try to change the title to introduce the tag &lt;strong&gt;&amp;lt;br&amp;gt;&lt;/strong&gt; into the output of the HTML markup, using this time the code &lt;strong&gt;[br]&lt;/strong&gt; in order to bypass the mechanism used by Joomla that prevents us to insert any HTML tags directly into the HTML markup for the page:&lt;/p&gt;  &lt;p&gt;&lt;img title="tmp28C" style="border-right: 0px; border-top: 0px; display: block; float: none; margin: 16px auto; border-left: 0px; border-bottom: 0px" height="104" alt="tmp28C" src="http://lh4.ggpht.com/_w76XuJflOGw/S0gztsu9oYI/AAAAAAAAFgg/YNTnT-VkZ6c/tmp28C%5B2%5D.png?imgmax=800" width="365" border="0" /&gt;&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.5em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.5em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0em"&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;Sylvain&lt;font color="#ff0000"&gt;[br]&lt;/font&gt;Lafontaine.com&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;which gives us the following result:&lt;/p&gt;  &lt;p&gt;&lt;img title="tmp4EE" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="47" alt="tmp4EE" src="http://lh6.ggpht.com/_w76XuJflOGw/Sv6ItGf_TVI/AAAAAAAACrw/c66iIA6p4B4/tmp4EE%5B19%5D.png?imgmax=800" width="214" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;The solution seems to be determined to be delayed. This time, one gets a newline but only the first line is visible. Furthermore, this title does not seem to be centered horizontally.&lt;/p&gt;  &lt;p&gt;There are several things to identify here. The first is that the menus in the templates of Artisteer are of a fixed height, so the first thing to do is to increase the height of tabs in the template Artisteer. This operation is relatively easy to perform and gives us the following result:&lt;/p&gt;  &lt;p&gt;&lt;img title="tmp4EF" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="149" alt="tmp4EF" src="http://lh6.ggpht.com/_w76XuJflOGw/Sv6IuKNrFTI/AAAAAAAACpU/3J5cnVrC-o0/tmp4EF%5B8%5D.png?imgmax=800" width="550" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;img title="tmp4B9" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="66" alt="tmp4B9" src="http://lh5.ggpht.com/_w76XuJflOGw/Sv6IvAlOTXI/AAAAAAAACtQ/j_RuBvncUv8/tmp4B9%5B9%5D.png?imgmax=800" width="257" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;What happened here? There are two problems. The first is the height of lines of text in the menu as defined by Artisteer. In order to center vertically the line of text, Artisteer assigns a high value for the line-height property - here it has been set to 47px but the value for your own template might be different - as we can see from the following CSS snippet:&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.5em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.5em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0em"&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;.art-menu a .t        &lt;br /&gt;{         &lt;br /&gt;font-family: Arial, Helvetica, Sans-Serif;         &lt;br /&gt;font-size: 12px;         &lt;br /&gt;font-style: normal;         &lt;br /&gt;font-weight: normal;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; color: #C7E2F0;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; padding: 0 17px;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; margin: 0 6px;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;line-height: 47px;&lt;/span&gt;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; text-align: center;         &lt;br /&gt;}&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;To better understand the following explanation, we have to mention here that the HTML produced by Artisteer to produce the menu is a &amp;quot;no table&amp;quot; or &amp;quot;tableless&amp;quot; type; which means that the &amp;quot;table&amp;quot; tag is not used for displaying the horizontal strip of tabs.&amp;#160; Instead, the template generates a list of &lt;strong&gt;&amp;lt;li&amp;gt;&lt;/strong&gt; tags, each one containing a single tab from the menu. In order to produce the graph rounded button with the text at the center, these tags contain a list of &lt;strong&gt;&amp;lt;span&amp;gt;&lt;/strong&gt; tags: one for the left side of the button (class = &amp;quot;l&amp;quot;), one for the right side (class = &amp;quot;r&amp;quot;) and finally one to contain the title text itself (class = &amp;quot;t&amp;quot;):&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.5em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.5em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="font-size: 14px; margin: 0em; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;lt;ul class=&amp;quot;art-menu&amp;quot;&amp;gt;      &lt;br /&gt;&amp;#160; ...       &lt;br /&gt;&amp;#160;&amp;#160; &amp;lt;li id=&amp;quot;current&amp;quot; class=&amp;quot;active item47&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;a href=&amp;quot;...&amp;quot; class=&amp;quot;active&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;span class=&amp;quot;l&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;span class=&amp;quot;r&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;span class=&amp;quot;t&amp;quot;&amp;gt;Sylvain&amp;lt;br /&amp;gt;Lafontaine.com&amp;lt;/span&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/a&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160; &amp;lt;/li&amp;gt;       &lt;br /&gt;&amp;#160; ...       &lt;br /&gt;&amp;lt;/ul&amp;gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;By taking advantage of the fact that Joomla has added the ID of each menu as a class to each &lt;strong&gt;&amp;lt;li&amp;gt;&lt;/strong&gt; tag of the menu (here the &amp;quot;item47&amp;quot;, see below), we can introduce the following CSS style to make a quick test:&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.5em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.5em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0em"&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;.art-menu &lt;span style="background-color: yellow"&gt;li.item47&lt;/span&gt; a .t         &lt;br /&gt;{         &lt;br /&gt;font-family: Arial, Helvetica, Sans-Serif;         &lt;br /&gt;font-size: 12px;         &lt;br /&gt;font-style: normal;         &lt;br /&gt;font-weight: normal;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; color: #C7E2F0;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; padding: 0 17px;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; margin: 0 6px;&amp;#160;&amp;#160; &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;line-height: normal;          &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;#160;&amp;#160;&amp;#160; text-align: center;        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;position:relative; top:8px;          &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;}&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Ah! Finally, we can see now that we are approaching the goal: &lt;/p&gt;  &lt;p&gt;&lt;img title="tmp4BF" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="75" alt="tmp4BF" src="http://lh3.ggpht.com/_w76XuJflOGw/Sv6IwbH7bPI/AAAAAAAACtU/rycBySTPS1E/tmp4BF%5B8%5D.png?imgmax=800" width="241" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;We see that the two lines of the title are now visible but they are not well centered. This is because the tags &lt;strong&gt;&amp;lt;span&amp;gt;&lt;/strong&gt; - used to display text - are not HTML blocks like the tag&amp;#160; &amp;lt;div&amp;gt; and therefore they can not be centered. It's more easy to see the phenomenon if we complete the first line by adding the text &amp;quot;blablabla&amp;quot; at its end: the first line finish at the right margin of the enclosing block while the second line begin at the left margin:&lt;/p&gt;  &lt;p&gt;&lt;img title="tmp4C0" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="76" alt="tmp4C0" src="http://lh5.ggpht.com/_w76XuJflOGw/Sv6IxLJyFGI/AAAAAAAACtY/wNM8pKBKaIw/tmp4C0%5B10%5D.png?imgmax=800" width="234" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;So there is absolutely no effect of centering here inside the &amp;lt;span&amp;gt; tag when more than a single line is displayed.&amp;#160; The solution is to introduce a &amp;lt;div&amp;gt; block directly inside the &amp;lt;span&amp;gt;...&amp;lt;/span&amp;gt; if we want to center the title when it's written on more than a single line. This &amp;lt;div&amp;gt; block can easily be added using the same technique as before for the &amp;lt;br&amp;gt; tag by using again the yvBBCode plugin.&amp;#160; However, this time, the &amp;lt;div&amp;gt; tag is not part of the standard list of BB codes offered by the yvBBCode plugin, so we must first add it to the list.&lt;/p&gt;  &lt;p&gt;To do this we must change the file Extended.php that you'll find in the directory &lt;strong&gt;.\www\plugins\system\yvbbcode\BBCodeParser\Filter&lt;/strong&gt; if you change the installation Zip file of the plugin directly or in the directory &lt;strong&gt;.\plugins\system\yvbbcode\BBCodeParser\Filter&lt;/strong&gt; of your Joomla installation if you want to edit the file after the installation.&lt;/p&gt;  &lt;p&gt;The piece of code below highlighted below in yellow is what you need to add in the &lt;strong&gt;HTML_BBCodeParser_Filter&lt;/strong&gt; function of the &lt;strong&gt;HTML_BBCodeParser_Filter_Extended&lt;/strong&gt; class that you'll find in the file.&amp;#160; You must also be careful to add a comma at the end of the previous code as it is shown below in red.&amp;#160; &lt;em&gt;Notice that with some older versions of the yvBBCode plugin, the &lt;strong&gt;[br]&lt;/strong&gt; code is also absent, so you must add it too. Simply use the same code as below for &lt;strong&gt;'br'&lt;/strong&gt;.&lt;/em&gt;&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.5em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.5em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0em"&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;class HTML_BBCodeParser_Filter_Extended extends        &lt;br /&gt;HTML_BBCodeParser_Filter {         &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ...        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;#160; 'h6' =&amp;gt; array('htmlopen'&amp;#160; =&amp;gt; 'h6',        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'htmlclose' =&amp;gt; 'h6',        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'allowed'&amp;#160;&amp;#160; =&amp;gt; 'all',        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'attributes'=&amp;gt; array()),        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;#160; 'br' =&amp;gt; array('htmlopen'&amp;#160; =&amp;gt; 'br',        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'htmlclose' =&amp;gt; '',        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'allowed'&amp;#160;&amp;#160; =&amp;gt; 'all',        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'attributes'=&amp;gt; array())&lt;span style="background-color: red"&gt;,          &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;      &lt;br /&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: yellow"&gt;&amp;#160; 'div' =&amp;gt; array('htmlopen'&amp;#160; =&amp;gt; 'div',        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: yellow"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'htmlclose' =&amp;gt; 'div',        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: yellow"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'allowed'&amp;#160;&amp;#160; =&amp;gt; 'all',        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: yellow"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'attributes'=&amp;gt; array())        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;);&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;We then add the following CSS style template for Internet Explore (for FireFox, see the proper CSS code at the end of this article) to format the &lt;strong&gt;&amp;lt;div&amp;gt; &lt;/strong&gt;tag&lt;strong&gt;:&lt;/strong&gt;&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.5em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.5em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0em"&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;.art-menu a .t &lt;span style="background-color: yellow"&gt;div          &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;{        &lt;br /&gt;font-family: Arial, Helvetica, Sans-Serif;         &lt;br /&gt;font-size: 12px;         &lt;br /&gt;font-style: normal;         &lt;br /&gt;font-weight: normal;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; color: #C7E2F0;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; padding: 0 17px;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; margin: 0 6px;         &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;line-height: normal;          &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;#160;&amp;#160;&amp;#160; text-align: center;        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background-color: yellow"&gt;position:relative; top:8px;          &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;}        &lt;br /&gt;        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;.art-menu a:hover .t div {        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; color: #131B20;         &lt;br /&gt;}         &lt;br /&gt;        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;.art-menu li:hover a .t div &lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;{        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; color: #131B20;         &lt;br /&gt;}         &lt;br /&gt;        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;.art-menu li:hover&amp;gt;a .t div {        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; color: #131B20;         &lt;br /&gt;}         &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;       &lt;br /&gt;.art-menu a.active .t div {         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; color: #2E424C;         &lt;br /&gt;} &lt;/span&gt;&lt;font style="background-color: #ffffff" face="Consolas"&gt;&lt;/font&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Finally, we can now use our new &lt;strong&gt;BB&lt;/strong&gt; code to enclose our title menu in a &amp;lt;div&amp;gt;...&amp;lt;/div&amp;gt; block and with an embedded line break so that our title will now be correctly displayed on two lines:&lt;/p&gt;  &lt;p&gt;&lt;img title="tmp28B" style="border-right: 0px; border-top: 0px; display: block; float: none; margin: 16px auto; border-left: 0px; border-bottom: 0px" height="101" alt="tmp28B" src="http://lh6.ggpht.com/_w76XuJflOGw/SwRma5P6GKI/AAAAAAAAFgk/cWsq7Cfr_Eo/tmp28B%5B2%5D.png?imgmax=800" width="384" border="0" /&gt;&lt;/p&gt;  &lt;div style="border-right: #b2d1d7 1px solid; padding-right: 0.5em; border-top: #b2d1d7 1px solid; padding-left: 0.6em; padding-bottom: 0.5em; margin: 16px 10px; overflow: auto; border-left: #b2d1d7 1px solid; padding-top: 0.5em; border-bottom: #b2d1d7 1px solid; background-color: #ebf3f5"&gt;   &lt;p style="margin: 0em"&gt;&lt;span style="font-size: 14px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace"&gt;&lt;font color="#ff8000"&gt;[div]&lt;/font&gt;Sylvain&lt;font color="#ff0000"&gt;[br]&lt;/font&gt;Lafontaine.com&lt;font color="#ff8000"&gt;[/div]&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;with the final result:&lt;/p&gt;  &lt;p&gt;&lt;img title="tmp4B8" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="149" alt="tmp4B8" src="http://lh3.ggpht.com/_w76XuJflOGw/Sv6IyRxHySI/AAAAAAAACpk/bg3Ahl9DqC4/tmp4B8%5B10%5D.png?imgmax=800" width="550" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="The Coding Paparazzi - english.sylvainlafontaine.com" href="http://coding-paparazzi.sylvainlafontaine.com/2009/11/title-menu-on-two-lines-for-joomla.html"&gt;&lt;img title="tmpB5F" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 16px auto; border-right-width: 0px" height="81" alt="tmpB5F" src="http://lh4.ggpht.com/_w76XuJflOGw/Sv_cSrW6aZI/AAAAAAAACtk/nYUZnJHRwL8/tmpB5F%5B12%5D.png?imgmax=800" width="372" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;One can see that the title now appears correctly on two lines, is well centered but horizontally and vertically and that the other tabs remain unchanged.&lt;/p&gt;  &lt;p&gt;One last word before finishing. In the case of Firefox, the code above does not work directly as is. This is because Firefox will introduce a line break before the start of the display of the &lt;strong&gt;&amp;lt;div&amp;gt;&lt;/strong&gt; block nested inside the &lt;strong&gt;&amp;lt; span&amp;gt; &lt;/strong&gt;with the effect that the title will now be positioned below the tab and will most likely invisible. To correct this, just put a CSS code specific to Firefox which will raise the text.&amp;#160; Here, this can be done easily by simply replacing the &amp;quot;&lt;strong&gt;top: 8px;&lt;/strong&gt;&amp;quot; with a &amp;quot;&lt;strong&gt;top: -38px;&lt;/strong&gt;&amp;quot; for Firefox.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;Copyright © 2009-2010 &lt;a href="http://www.sylvainlafontaine.com/"&gt;&lt;strong style="color: #134753;"&gt;Sylvain Lafontaine&lt;/strong&gt;&lt;/a&gt;.&amp;nbsp; All rights reserved.&lt;br/&gt;
Web site : &lt;a href="http://coding-paparazzi.sylvainlafontaine.com"&gt;&lt;strong style="color: #134753;"&gt;coding-paparazzi.sylvainlafontaine.com&lt;/strong&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; 
Email : &lt;a href="mailto:sylvainlafontaine2009@yahoo.ca"&gt;&lt;strong style="color: #134753;"&gt;sylvainlafontaine2009@yahoo.ca&lt;/strong&gt;&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4597579859901368488-8786877689734281955?l=coding-paparazzi.sylvainlafontaine.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fTIJk0ZWCL_k5xM3FaZO6ePv_KY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fTIJk0ZWCL_k5xM3FaZO6ePv_KY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fTIJk0ZWCL_k5xM3FaZO6ePv_KY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fTIJk0ZWCL_k5xM3FaZO6ePv_KY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheCodingPaparazzi/~4/ZgZ6Sh2fUOg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://coding-paparazzi.sylvainlafontaine.com/feeds/8786877689734281955/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://coding-paparazzi.sylvainlafontaine.com/2009/11/title-menu-on-two-lines-for-joomla.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/8786877689734281955?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4597579859901368488/posts/default/8786877689734281955?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TheCodingPaparazzi/~3/ZgZ6Sh2fUOg/title-menu-on-two-lines-for-joomla.html" title="Joomla navigational menu&amp;#39;s titles on two lines with an Artisteer template" /><author><name>Sylvain Lafontaine</name><uri>http://www.blogger.com/profile/08439067731828915631</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_w76XuJflOGw/S0EvrjQTAqI/AAAAAAAAFc8/MeCzPdBteeg/S220/Sylvain+-+thumbnail,+carre,+54x54px,+version+3.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_w76XuJflOGw/Sv6Ir-fURTI/AAAAAAAACrc/792rfbP1YNY/s72-c/tmp4F118.png?imgmax=800" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://coding-paparazzi.sylvainlafontaine.com/2009/11/title-menu-on-two-lines-for-joomla.html</feedburner:origLink></entry></feed>

