Sunday, October 10, 2010

How to Display Multiple Ads in the Left Navigation?

You can find the solution for adding ads to the left navigation at http://solutionsforofficelive.com/googleadsense2.aspx.

The easiest way to add multiple ads to the left navigation is to add two sets of code for an ad and separating them with a <br /> tag.  If you want more ads simply add an <br /> tag between the ad codes.  Also if you want additional space between the ads simply add additional <br /> tags.  You should be able to insert ads from multiple sources if desired.  These codes use the Custom Footer Module or Custom Header and Navigation module as well.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:template match="/">
<div id="adLoader">
Replace this is the first ad code
<br />
Replace this is the second ad code
</div>
<script type="text/javascript">
var leftNav = document.getElementById('IWS_WH_Elem_LeftNav');
leftNav.appendChild(document.getElementById('adLoader'));
</script>
</xsl:template>
</xsl:stylesheet>

Example:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:template match="/">
<div id="adLoader">
<script type="text/javascript"><![CDATA[<!--
google_ad_client = "pub-47734912835080";
/* Left Nav 160x600 Text or Image */
google_ad_slot = "50235832";
google_ad_width = 160;
google_ad_height = 600;
//-->]]>
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br /><br />
<script type="text/javascript"><![CDATA[<!--
google_ad_client = "pub-47734912835080";
/* Left Nav 160x600 Text or Image */
google_ad_slot = "50235832";
google_ad_width = 160;
google_ad_height = 600;
//-->]]>
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<script type="text/javascript">
var leftNav = document.getElementById('IWS_WH_Elem_LeftNav');
leftNav.appendChild(document.getElementById('adLoader'));
</script>
</xsl:template>
</xsl:stylesheet>

Monday, October 4, 2010

New Blog

For those of you who do not know this, Windows Live Spaces is transitioning over to WordPress.  This effectively breaks the OLSB Blog module and your webpage if you happen to have the module on one of your webpages.  Since the blog has to be moved, I decided to abandon Windows Live completely (WordPress) and go with Blogger.  I have transitioned the old blog over to WordPress and it can be found here: http://officelivesolutions.wordpress.com/.  The new blog at blogger can be found at: http://solutionsforofficelive.blogspot.com/.

Now that the blog was moved I had to address the issue with the Space Blog Module.  First I removed the module from the homepage, which incidentally was broken because of that!  Next I used a RSS reader from: http://feed.informer.com/.  I tried a number of different ones but this one seemed to work the best for what I wanted.  Once I had the RSS feed setup with feed.informer, I copied the code (I used the JavaScript version) and used the Custom Footer Module to embed it on the homepage.  The results can be seen at http://solutionsforofficelive.com.

The Code:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" omit-xml-declaration="yes"/>
<xsl:template match="/">
<![CDATA[
<script type="text/javascript" src="
http://app.feed.informer.com/digest3/FYYSDVKBXC.js">
<noscript><a href="
http://app.feed.informer.com/digest3/FYYSDVKBXC.html">Click for &quot;Solutions for Office Live Blog&quot;.</a>
Powered by <a href="
http://feed.informer.com/">RSS Feed Informer</a></noscript></script>
]]>
</xsl:template>
</xsl:stylesheet>

Sunday, February 21, 2010

How to get codes with a <form> tag working in Office Live?

Since my last entry, I have had a number of users say they still are not able to get code to work in Office Live.  There have been two main reasons, 1.  The Custom Footer Module is broken.  The simple solution is simply use one of the other custom modules (Custom Header or Custom Navigation).  The second reason is codes that have a <form> tag in the code, this can include contact us forms, or even Google’s Search box has a <form> tag in it.

To make a code with a <form> tag work in Office Live, use the following base codes, these codes work in all the Custom modules.  There are two base codes, one for strict XHTML and one for codes that may not conform to XHTML standards.  If possible use the strict XHTML base code.  If the code does not work then use the second base code.

Base code for XHTML compliant codes:

Your code would go on line #5

1: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
2: <xsl:output method="html" omit-xml-declaration="yes"/>
3: <xsl:template match="/">
4: <xsl:text disable-output-escaping="yes"><![CDATA[</form>]]></xsl:text>
5:
6: <xsl:text disable-output-escaping="yes"><![CDATA[<form>]]></xsl:text>
7: </xsl:template>
8: </xsl:stylesheet>

Example:

<xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform version="1.0">
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:text disable-output-escaping="yes"><![CDATA[</form>]]></xsl:text>
<div align="left" >
<form action=http://solutionsforofficelive.com/search.aspx id="cse-search-box" style="background-color:#1b1b1b; background-repeat:repeat;width:275px; height:40px;">
<input type="hidden" name="cx" value="partner-pub-0488902814979569:dku8ma-8ngn" />
<input type="hidden" name="cof" value="FORID:11;NB:1" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" size="19" style="height:25px; vertical-align:middle; background-color:#ffffff; background-repeat:repeat; border : 1px solid #ff9900; font-size:12pt;"/>
<input type="image" src="/documents/mag_glass.gif" style="vertical-align:middle;" alt="Search" name="sa"/></form></div>
<xsl:text disable-output-escaping="yes"><![CDATA[<form>]]></xsl:text>
</xsl:template>
</xsl:stylesheet>

Base code for non-compliant codes:

Your code would go on line #6

1: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
2: <xsl:output method="text" omit-xml-declaration="yes"/>
3: <xsl:template match="/">
4: <![CDATA[
5: </form>
6:
7: <form>
8: ]]>
9: </xsl:template>
10: </xsl:stylesheet>

Example:

<xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform version="1.0">
<xsl:output method="text" omit-xml-declaration="yes"/>
<xsl:template match="/">
<![CDATA[
</form>
<div align="left" >
<form action=http://solutionsforofficelive.com/search.aspx id="cse-search-box" style="background-color:#1b1b1b; background-repeat:repeat;width:275px; height:40px;">
<input type="hidden" name="cx" value="partner-pub-0488902814979569:dku8ma-8ngn" />
<input type="hidden" name="cof" value="FORID:11;NB:1" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" size="19" style="height:25px; vertical-align:middle; background-color:#ffffff; background-repeat:repeat; border : 1px solid #ff9900; font-size:12pt;"/>
<input type="image" src="/documents/mag_glass.gif" style="vertical-align:middle;" alt="Search" name="sa"/></form></div>
<form>
]]>
</xsl:template>
</xsl:stylesheet>