<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>web.0 &#124; web development and design services - (x)html, css, javascript, jQuery, SharePoint 2010 / 2007, Magento, Wordpress, Joomla, Drupal, CakePHP, php, databases</title>
	<atom:link href="http://www.webpoint0.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webpoint0.com/blog</link>
	<description>The web.0 blog</description>
	<lastBuildDate>Mon, 23 Jan 2012 11:56:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>SharePoint 2010 on the iPad, fixing one finger scrolling</title>
		<link>http://www.webpoint0.com/blog/sharepoint-2010-ipad-one-finger-scrolling/</link>
		<comments>http://www.webpoint0.com/blog/sharepoint-2010-ipad-one-finger-scrolling/#comments</comments>
		<pubDate>Thu, 12 May 2011 13:05:06 +0000</pubDate>
		<dc:creator>web.0</dc:creator>
				<category><![CDATA[Javascript, AJAX and jQuery]]></category>
		<category><![CDATA[SharePoint design and development]]></category>
		<category><![CDATA[Themes, skins and front ends]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Progressive enhancement]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://www.webpoint0.com/blog/?p=146</guid>
		<description><![CDATA[We&#8217;ve been working on an mobile version of a SharePoint 2010 implementation for a customer recently, specifically generating an iPad version of elements of their intranet. It&#8217;s been very interesting getting used to developing for the various touch events and also coding to cope with the way the iPad copes with scrollable divs. As part [...]]]></description>
			<content:encoded><![CDATA[<p><a title="sharepoint one finger scrolling on the iPad" href="http://www.webpoint0.com/blog/wp-content/uploads/2011/05/sharepoint-one-finger-scroll-ipad.jpg" rel="shadowbox"><img class="alignright" title="sharepoint one finger scrolling on the iPad" src="http://www.webpoint0.com/blog/wp-content/uploads/2011/05/sharepoint-one-finger-scroll-ipad-150x150.jpg" alt="sharepoint one finger scrolling on the iPad" width="150" height="150" /></a>We&#8217;ve been working on an mobile version of a SharePoint 2010 implementation for a customer recently, specifically generating an iPad version of elements of their intranet. It&#8217;s been very interesting getting used to developing for the various touch events and also coding to cope with the way the iPad copes with scrollable divs. As part of the process, we needed to make the rest of the intranet work with standard single finger scrolling with the ribbon in place, which SharePoint 2010 doesn&#8217;t do out of the box. Here&#8217;s how to fix it;<span id="more-146"></span></p>
<p><strong>Update 23/09/2011: </strong>As pointed out by a couple of people in the comments, there are some issues around using this fix and some elements of certain types of page no longer working (namely some select boxes). A potential fix is linked to in the comments, but for reference have a look at <a title="Stack Overflow" href="http://stackoverflow.com/questions/5745374/iscroll-4-problem-with-form-select-element-iphone-safari-and-android-browser">this</a>;</p>
<p>The standard version of SharePoint uses a fairly complex javascript system to position the ribbon so that it sticks to the top of the screen and the rest of the body scrolls underneath it, which we need to work around. We can do this in two ways. We could use the <a title="Fixed width layouts, the scrollbar and the ribbon in SharePoint 2010. A better way?" href="http://www.webpoint0.com/blog/fixed-width-layouts-scrollbar-ribbon-sharepoint-2010/">earlier fix we have described on this blog</a> to fix the ribbon positioning to work in a different way, which would give us the scrolling body back, which makes one finger scrolling work again. However, as stated in the update of that post, there has to be a javascript fix added to solve the dropdown menus so you should decide if you want to use it or not. So, as an alternative, here&#8217;s another way that works more with out of the box stuff. (This solution is based on the out of the box v4.master master page file). This should work for both iPad and Android devices (if you turn off mobile view it should work for iPhone too), but has only been tested on an iPad.</p>
<p>Aside: If you want this to work on just an iPad, you could conditionally execute the code based on something like the user agent string, like so;</p>
<pre class="brush: jscript; title: ; notranslate">
if (navigator.userAgent.match(/iPad/i) != null) {
// execute code here
}
</pre>
<p>For this fix we are going to use a javascript library we found while doing the main part of the project, the excellent <a title="iScroll 4" href="http://cubiq.org/iscroll-4" target="_blank">iScroll 4</a>. We recommend you check it out if you are developing web pages for mobile devices. So, download the iscroll.js file from that site, add it in to your site somewhere (for this example we&#8217;ll just use the root of the style library, but put it wherever you keep your javascript files), and then link to it from your master page in the head element like so;</p>
<pre class="brush: xml; title: ; notranslate">&lt;script type=&quot;application/javascript&quot; src=&quot;/Style%20Library/iscroll.js&quot;&gt;&lt;/script&gt;</pre>
<p>Then, we need to add in some javascript code to set up the iScroll for the main body area, and also keep it up to date when the ribbon is dynamically changed by SharePoint. So, beneath the line above or in an external js file which you then link to, add the following code;</p>
<pre class="brush: jscript; title: ; notranslate">
var bodyscrolldiv, bodyscrolldivinit = false;

function loaded() {
ExecuteOrDelayUntilScriptLoaded(function () { SP.UI.Workspace.add_resized(mobilebodyscroll); }, &quot;init.js&quot;);
}

function mobilebodyscroll() {
if (bodyscrolldivinit) {
bodyscrolldiv.refresh();
} else {
bodyscrolldiv = new iScroll('s4-workspace');
bodyscrolldivinit = true;
}
}

document.addEventListener('DOMContentLoaded', loaded, false);
</pre>
<p>This will cope with the ribbon events as different tabs are clicked and it gets shown and hidden, etc. To finish and make it work though, we also need to change some html.</p>
<p>We need to wrap everything <em>inside</em> the div with the id &#8216;<strong>s4-workspace</strong>&#8216; with an additional div, so that the scroll can be effectively applied to it and work. This additional div needs the style attribute set against it of &#8216;<strong>overflow: auto;</strong>&#8216;  We&#8217;d recommend doing this with a class, and then a declaration in a style sheet, but will show it here as a style attribute for ease of readings sake;</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;s4-workspace&quot;&gt;
&lt;div style=&quot;overflow:auto;&quot;&gt;
... the s4-bodyContainer div and other content elements...
&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>And that&#8217;s it. This now works for us. You can scroll the page with one finger in both orientations and with/without the ribbon, and still get to ribbon dropdowns and so on, and everything copes with the various heights.</p>
<p>So there you have it, a fix to let you enjoy SharePoint 2010 as it was intended on your iPad or Android device!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpoint0.com/blog/sharepoint-2010-ipad-one-finger-scrolling/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010 branding and development tips and tricks</title>
		<link>http://www.webpoint0.com/blog/sharepoint-2010-branding-and-development-tips-and-tricks/</link>
		<comments>http://www.webpoint0.com/blog/sharepoint-2010-branding-and-development-tips-and-tricks/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 16:54:55 +0000</pubDate>
		<dc:creator>web.0</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[SharePoint design and development]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.webpoint0.com/blog/?p=126</guid>
		<description><![CDATA[We have been doing a lot of SharePoint 2010 branding and custom development over the last 6 months or so which has kept us both busy, which is good, and away from the blog, which is not ideal. So, we thought the best thing we could do to keep generating something useful for people to [...]]]></description>
			<content:encoded><![CDATA[<p>We have been doing a <em>lot</em> of SharePoint 2010 branding and custom development over the last 6 months or so which has kept us both busy, which is good, and away from the blog, which is not ideal. So, we thought the best thing we could do to keep generating something useful for people to read and also help ourselves keep track of all the nuances of SharePoint 2010 development, we&#8217;d make a list of as many as possible of the little tips, tricks and hints we have been learning along the way. A sort of cheat sheet. <span id="more-126"></span>And we&#8217;d like to share it, and hopefully get some additional ideas from the community that will help us grow it. So here&#8217;s our list so far, with links to relevant articles and posts where things need further explanation. If you have any things you think would be a good addition to the list, we&#8217;d love to hear about it, so post us a comment, and the good ones will get added to the list, along with credit of course.</p>
<p>We hope these tricks help, and happy developing!</p>
<ol>
<li>When designing for intranet sites, it&#8217;s best to design for a full width ribbon. A fixed width ribbon with a decent looking scrollbar <a title="find out more about customising the ribbon" href="fixed-width-layouts-scrollbar-ribbon-sharepoint-2010">can be done</a>, but there are so many javascript based changes and updates involved in loading and rendering the ribbon, it can have unintended consequences for certain browser users, so unless your client is desperate for it, you might be able to save them time and cost by suggesting a full width ribbon from the start.</li>
<li>In public facing web sites, don&#8217;t even start to load the ribbon in anonymous mode unless you need to, it <em>hugely </em>increases render time. You can do this by only loading the ribbon code and a certain piece of JavaScript in edit mode, or on a user permissions basis using a securitytrimmedcontrol. For more details, see <a title="Article on ribbon positioning" href="http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?PageType=4&amp;ListId={72C1C85B-1D2D-4A4A-90DE-CA74A7808184}&amp;pID=426" target="_blank">this article</a></li>
<li> If you are using a full width ribbon and the standard scrollbar, you can achieve a fixed width for the body by using the &#8216;s4-nosetwidth&#8217; class on the div tag with the ID &#8216;s4-workspace&#8217;, and then applying a fixed width to that div, or by applying a fixed width to the div with the ID &#8216;s4-bodycontainer&#8217;, and leaving it&#8217;s parent alone.</li>
<li>The new JavaScript Client Object Model is awesome. And a good way of quickly achieving an interactive web part in an intranet environment, but if you are planning on using it a lot, make sure you read up on request batching. For single list reading, try <a title="Using the ECMAscript/JavaScript Client Object Model to read lists in SharePoint 2010" href="http://www.webpoint0.com/blog/using-the-ecmascriptjavascript-client-object-model-to-read-lists-in-sharepoint-2010/" target="_blank">this method</a>.</li>
<li>The JavaScript Client Object Model get_lists function is restricted when anonymous mode is enabled. Which is a shame. We don&#8217;t know what the reason for this is, or the security implications of turning it on, so do this at your own risk, but you can un-restrict  it using a simple powershell command, detailed below.<br />
In powershell, use the following commands;</p>
<pre class="brush: plain; title: ; notranslate">
$wa = Get-SPWebApplication http://yourwebappurl
$wa.ClientCallableSettings.AnonymousRestrictedTypes.Remove([Microsoft.SharePoint.SPList], &quot;GetItems&quot;)
$wa.Update()
</pre>
</li>
<li>When using the JavaScript Client Object Model, ensure that the relevant SharePoint core JavaScript file has loaded before calling your function. You can do this by using the built in function &#8216;<strong>ExecuteOrDelayUntilScriptLoaded</strong>&#8216;, like so;
<pre class="brush: jscript; title: ; notranslate">
ExecuteOrDelayUntilScriptLoaded(yourfunctioncall, &quot;sp.js&quot;);
</pre>
</li>
<li>Custom content types do not overwrite their bound versions on lists and libraries when you upgrade your project by adding a field or something. There are manual ways of solving this, or you can use a feature receiver to do the work for you.</li>
<li> Deploying from Visual Studio 2010 using right click &gt; deploy is great and very useful but doesn&#8217;t always work the same way as doing a deployment manually using powershell, stsadm, or Central Admin. It is good practice to test your projects using both methods.</li>
<li>A good <a title="starter master pages" href="http://blog.drisgill.com/2010/03/updated-2010-starter-master-pages-up-on.html">master page</a> to start from is a great idea.</li>
<li>If you don&#8217;t have to load the out of the box sharepoint css and javascript  for your public facing site (I can&#8217;t see an intranet not needing them), then don&#8217;t, as they can have an impact on page load and rendering times. You can achieve this with the CSS by using security trimmed controls or edit mode panels for your &lt;sharepoint:csslink&gt; tag in the master page, and NOT using the &lt;sharepoint:cssregistration&gt; tag to register your custom CSS file, but a simple html &lt;link&gt; tag instead. The same is true for the javascript, but for the &lt;sharepoint:scriptlink&gt; tag, and if you are using any OOTB web parts, you still need some js stuff to make it all work, see <a title="Chris O'Brien: Eliminating large JS files to optimize SharePoint 2010 internet sites" href="http://www.sharepointnutsandbolts.com/2011/01/eliminating-large-js-files-to-optimize.html" target="_blank">this post</a> for more details.</li>
<li>When creating content in your master page / page layouts that you don&#8217;t want picked up by the search index, add the class &#8216;noindex&#8217; to any divs containing content you don&#8217;t want crawled, <em>including </em>ones nested inside divs that already have this class, as it does not inherit.</li>
<li>If you are using right click &gt; deploy in Visual Studio to deploy to sharepoint and you are getting weird errors about values not being able to be null and the like, make sure you close any files you have open in Visual Studio and try again. 9 times out of 10 this fixes the problem. Thanks to <a title="Glyn Clough's blog" href="http://glynblogs.com" target="_blank">Glyn Clough</a> for that little gem.</li>
<li>Having a search core results web part on your home page (say to show the latest 5 items in a list or something like that), can cause the crawler to fail. If you are finding content isn&#8217;t being indexed and you have one of these, try removing it temporarily to see if that solves the problem. If it does, there is an update available from the Microsoft web site that fixes the issue.</li>
<li>When creating custom xsl style sheets for things like core search results and content query web parts, there are some handy functions available that have already been made, if you know where to look. Try adding <strong>xmlns:srwrt=&#8221;http://schemas.microsoft.com/WebParts/v3/searchresults/runtime&#8221;</strong> to your xsl:stylesheet tag, to allow you to use the GetPlainTextFromHtml function in that schema. It&#8217;s great for getting plain text intros in rollups from rich html body content, a regular requirement.</li>
</ol>
<p>That&#8217;s it for now, if you have any to add, let us know!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpoint0.com/blog/sharepoint-2010-branding-and-development-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using the ECMAscript/JavaScript Client Object Model to read lists in SharePoint 2010</title>
		<link>http://www.webpoint0.com/blog/using-the-ecmascriptjavascript-client-object-model-to-read-lists-in-sharepoint-2010/</link>
		<comments>http://www.webpoint0.com/blog/using-the-ecmascriptjavascript-client-object-model-to-read-lists-in-sharepoint-2010/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 14:58:45 +0000</pubDate>
		<dc:creator>web.0</dc:creator>
				<category><![CDATA[Javascript, AJAX and jQuery]]></category>
		<category><![CDATA[SharePoint design and development]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.webpoint0.com/blog/?p=131</guid>
		<description><![CDATA[The new Client Object Model in SharePoint 2010 is awesome. Well, awesome for front end developers like us, who do mostly branding and some C# based web parts for our customers. On intranet projects it enables us to use our JavaScript skills to rapidly develop custom web parts for our clients with little or no [...]]]></description>
			<content:encoded><![CDATA[<p>The new Client Object Model in SharePoint 2010 is awesome. Well, awesome for front end developers like us, who do mostly branding and some C# based web parts for our customers. On intranet projects it enables us to use our JavaScript skills to rapidly develop custom web parts for our clients with little or no need for compiled code, and brings that AJAX-like, web 2.0 feel that is very popular in web based applications these days. <span id="more-131"></span>The premise is simple, use one function to prepare your list query, then execute it asynchronously, then call one or another function depending on whether the call succeeded or failed. It&#8217;s a round-trip to the server, so it&#8217;s best to only get the fields from the list that you actually need, and to implement request batching if you are going to be doing a lot of it, but here&#8217;s a simple example of reading a list to get you started. Note that OOTB this works for authenticated users only, the get_lists function is restricted by default to anonymous users. This can be changed, but research needs to be done in to the security reasons for it being turned off in the first place before you do.</p>
<p>First, a function that does the list querying:</p>
<pre class="brush: jscript; title: ; notranslate">

function getTheList() {
 // get the list by it's name from the root site level

// Get the current client context to start. Most things run from the client context.
 clientContext = new SP.ClientContext.get_current();
// traverse up through the site to the root level, and get the list called 'my-list'.
// the root level isn't required, you can get a list from your current site level if you want, just use get_web() instead of get_site().get_rootWeb()
 var myList = clientContext.get_site().get_rootWeb().get_lists().getByTitle('my-list');

// use a standard syntax CAML query to filter your results and the fields returned if required, by adding the following, or passing parameters to the load command below
var query = new SP.CamlQuery();
// You can leave out this line if you just want to return the entire list.
query.set_viewXml('&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name=&quot;myField&quot;/&gt;&lt;Value Type=&quot;Text&quot;&gt;myValue&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;ViewFields&gt;&lt;FieldRef Name=&quot;myField1&quot;/&gt;&lt;FieldRef Name=&quot;myField2&quot;/&gt;&lt;/ViewFields&gt;&lt;/View&gt;');

// add your query to the getItems command for your list
this.collListItems = myList.getItems(query);

// issue the load command, these can be batched for multiple operations
clientContext.load(collListItems);

// execute the actual query against the server, and pass the objects we have created to either a success or failure function
 clientContext.executeQueryAsync(Function.createDelegate(this, this.mySuccessFunction), Function.createDelegate(this, this.myFailFunction));
}
</pre>
<p>Next, create functions that deal with both the success and failure state of your list read request.</p>
<pre class="brush: jscript; title: ; notranslate">

function mySuccessFunction() {
 // Do something useful like loop through your returned list items and output them somewhere
// create an enumerator to loop through the list with
 var listItemEnumerator = this.collListItems.getEnumerator();

// loop through the list items
 while (listItemEnumerator.moveNext()) {
 var oListItem = listItemEnumerator.get_current();
// do something with this here. Coupled with a platform like jQuery, you could do all kinds of great things
 strHtml += oListItem.get_item('myField1');
 }
 // output your html somewhere here.
 }

 function myFailFunction() {
 // do something to alert the user as to the error here.
}
</pre>
<p>Ok, so we have got the functions to read and output our list, so all that remains is to run them. SharePoint 2010 has a variety of options to manage how it loads its core javascript files, so also provides a useful helper function to enable us to only call our function once the Client Object model is full available, so after our functions we include the <strong>ExecuteOrDelayUntilScriptLoaded</strong> function call to initialise the first function only once the sp.js file has loaded;</p>
<pre class="brush: jscript; title: ; notranslate">

ExecuteOrDelayUntilScriptLoaded(getTheList, &quot;sp.js&quot;);
</pre>
<p>And that&#8217;s how it&#8217;s done!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpoint0.com/blog/using-the-ecmascriptjavascript-client-object-model-to-read-lists-in-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Masking Internet Explorers aliasing on fade problems</title>
		<link>http://www.webpoint0.com/blog/masking-internet-explorers-aliasing-on-fade-problems/</link>
		<comments>http://www.webpoint0.com/blog/masking-internet-explorers-aliasing-on-fade-problems/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 10:17:55 +0000</pubDate>
		<dc:creator>web.0</dc:creator>
				<category><![CDATA[Javascript, AJAX and jQuery]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Progressive enhancement]]></category>

		<guid isPermaLink="false">http://www.webpoint0.com/blog/?p=91</guid>
		<description><![CDATA[One of the problems we came across recently while building the front end for Content and Code&#8217;s new web site, specifically the home page news slider, was the way text aliasing is lost when fading things in and out in Internet Explorer. As the text begins to fade the aliasing appears to get turned off, and [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-103" title="ie-ugly-fade" src="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/ie-ugly-fade.png" alt="IE fades on text can look ugly, here's how to fix it." width="150" height="150" />One of the problems we came across recently while building the front end for <a title="Link to portfolio" href="http://www.webpoint0.com/portfolio.php#pt14">Content and Code&#8217;s</a> new web site, specifically the home page news slider, was the way text aliasing is lost when fading things in and out in Internet Explorer. As the text begins to fade the aliasing appears to get turned off, and the text goes all jagged. <span id="more-91"></span>Click the text in the box below for an example. (We are using the jQuery fadeIn and fadeOut methods here incidentally, and there are other ways of doing this but jQuery is great and easy, and we think you&#8217;ll have similar problems with other libraries or even custom code, but let us know if you have had different experiences).</p>
<div class="fade-examples-wrapper">
<div class="fade-example">This basic fade of text looks ugly in Internet Explorer, but not in other browsers. Click me while using IE to see.</div>
</div>
<p>This only happens in IE, not in any other major browser. This is due to the fact that IE does not support the CSS &#8216;opacity&#8217; property, and instead uses its own propriertary &#8216;filter&#8217; rule to deal with opactiy. Which appears to do some funky stuff to the aliasing of text when it is invoked. Not that this is an &#8216;I hate IE&#8217; kind of a post. Granted, a large number of the exceptions and issues we deal with at web.0 revolve around coding for the IE family of browsers because they work differently to the other major players, and a lot of corporate visitors still use old versions like 6 (shudder) and 7 (better, but still not very good), but the simple fact of the matter is people still use them whether we like it or not, and I don&#8217;t think we as web developers should try to force them not to use IE any more than Microsoft should try to force them to use it. Rather we should aim to make our sites the best experience possible for all our visitors, regardless of their mode of transport. Besides, IE 8 is for the most part fine (this problem and other notable excpetions like rounded border corners aside), and I have high hopes for IE9, so hopefully soon these exceptions will be a thing of the past anyway. So, as the majority of visitors to almost any website still use IE, and that isn&#8217;t likely to change any time soon, we needed to solve the problem. A search of the web revealed some techniques to solving this based around putting a background color on the container of the text you wish to fade, or programatically the filter attribute at the end of the animation, but neither seem to stop it looking ugly <em>during</em> the animation itself, or cope with things like picture backgrounds, etc. Again, click the text below to see what we mean.</p>
<div class="fade-examples-wrapper">
<div class="fade-example" style="background-color: #eee;">It even looks ugly when we put a background on the div being faded, even though it is thought in some circumstances that this should fix it. And it wouldn&#8217;t be easy to do this with a picture background anyway.</div>
</div>
<p>So, time to think outside the box. Or rather, on top of the box. What about if we didn&#8217;t fade the text at all? What if, rather than fade it in IE, we <em>masked</em> it, like you would in photoshop? Ok, let&#8217;s try that. So, first we detect whether or not your browser supports opacity (example of this later), using jQuery&#8217;s features detection routines (better than browser detection as there may be other browsers out there with this problem, so this way is more robust), and if so add our hidden mask in to the end of our container div, which we also set to be relatively positioned (you may need to change css and classes, etc to make this work for your situation, it&#8217;s just an example to start from) if it isn&#8217;t already, like so;</p>
<pre class="brush: jscript; title: ; notranslate">

// dynamically add the masking div, and make the container relatively positioned if it is not already
$('.masked-example-wrapper').css('position','relative').append('&lt;div&gt;&lt;/div&gt;');
//if what you are masking is dynamic in size, include this code to fit your masking div over the top, otherwise do this is css
$('.masking-div').css({
position : 'absolute',
width : $('.masked-example-wrapper').outerWidth()-2,
height : $('.masked-example-wrapper').outerHeight()-2,
zIndex : 100,
backgroundColor : '#eee',
display : 'none',
left : 0,
top : 0
});
</pre>
<p>Then, we add a slightly different binding to the click event for our div for browsers that do not support opacity only, and then the normal, easy fade option for browser that do support opacity, so the whole thing including the above ends up looking like;</p>
<pre class="brush: jscript; title: ; notranslate">

// check if opacity is not supported
if (!$.support.opacity) {
// dynamically add the masking div, and make the container relatively positioned if it is not already
$('.masked-example-wrapper').css('position','relative').append('&lt;div&gt;&lt;/div&gt;');
//if what you are masking is dynamic in size, include this code to fit your masking div over the top, otherwise do this is css
$('.masking-div').css({
position : 'absolute',
width : $('.masked-example-wrapper').outerWidth()-2,
height : $('.masked-example-wrapper').outerHeight()-2,
zIndex : 100,
backgroundColor : '#eee',
display : 'none',
left : 0,
top : 0
});
// now bind a slightly different function to the click event
$('.mask-example').click(function(){
$('.masking-div').fadeIn('slow',function(){
$(this).fadeOut('slow');
});
});
} else {
// opacity is supported, do things the normal, easy way.
$('.mask-example').click(function(){
$(this).fadeOut('slow',function(){
$(this).fadeIn('slow');
});
});
}
</pre>
<p>This way, when a user with a browser than doesn&#8217;t support opacity clicks in the text below, what actually happens is we fade <em>in</em> a mask over the top of the text, and then fade it back <em>out</em> again when we are done. This doesn&#8217;t invoke the filter on any text as the mask doesn&#8217;t contain any, and still keeps the underlying text looking nice and aliased, in all our visitors browsers. Click below for an example.</p>
<div class="masked-example-wrapper">
<div class="mask-example">This fixes it nicely, now doesn&#8217;t it?. Click me in IE to see.</div>
</div>
<p>And there you have it, a nice way to hide one of IE&#8217;s problems, so everyone gets the same experience. We like it so much, we use it on our own <a title="web.0 home page" href="/index.php">home page</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpoint0.com/blog/masking-internet-explorers-aliasing-on-fade-problems/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fixed width layouts, the scrollbar and the ribbon in SharePoint 2010. A better way?</title>
		<link>http://www.webpoint0.com/blog/fixed-width-layouts-scrollbar-ribbon-sharepoint-2010/</link>
		<comments>http://www.webpoint0.com/blog/fixed-width-layouts-scrollbar-ribbon-sharepoint-2010/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 08:04:29 +0000</pubDate>
		<dc:creator>web.0</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[SharePoint design and development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.webpoint0.com/blog/?p=69</guid>
		<description><![CDATA[The ribbon is a massive deal in SharePoint 2010. It is a big deal in all of the Microsoft Office suite, but especially so in SharePoint Server 2010.  And it is a fundamental change to the user experience for everyone. As designers we have to start to tailor our site styles to accomodate its inclusion, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-86" title="ribbon-example" src="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/ribbon-example.gif" alt="" width="150" height="150" />The ribbon is a massive deal in SharePoint 2010. It is a big deal in all of the Microsoft Office suite, but especially so in SharePoint Server 2010.  And it is a fundamental change to the user experience for everyone. As designers we have to start to tailor our site styles to accomodate its inclusion, and as developers we need to learn how to work with it, rather than against it in order to make for a useful user experience. This is especially true in intranet deployments, where we do a lot of our work, as the ribbon will almost certainly be there all the time.</p>
<p><span id="more-69"></span></p>
<p>However, lately we&#8217;ve come across a bit of a problem with the ribbon and the current fashion in web design, the fixed width layout. Everyone wants a fixed width layout these days, even on intranets, and there are a lot of really good arguments for having them. There is even a simple way built in to SharePoint 2010 to allow you to turn off the default behaviour of taking up the full width of the browser window. You&#8217;ll find plenty of blogs out there telling you how to do this, but personally I&#8217;d recommend you just head over to Randy Drisgill&#8217;s blog and pick up his <a href="http://blog.drisgill.com/2010/03/updated-2010-starter-master-pages-up-on.html">starter master pages</a>, as they are not only extremely useful when making custom sites, but also have some great comments in them to tell you where to edit for things like fixed width layouts. Or if you just want the info on setting the fixed width start at his other post <a href="http://blog.drisgill.com/2010/01/error-in-current-docs-for-upgrading.html">here</a>, and go from there.</p>
<p><strong>UPDATE 23/11/2010:</strong> This article has been updated as some issues were found with some of the popdown menus on the ribbon when using this method. We have fixed this here using jQuery and a timer, which is not ideal, as ultimately it would be better to use the existing sharepoint core javascript methods (if possible) to position items correctly in the first place. We have been looking through the debug versions of the core javascript, but they are almost completely undocumented and mostly minified so it&#8217;s pretty slow going, so you may consider this as an option in the interim. It&#8217;s your choice whether or not to use it at the end of the day, and if anyone has any suggestions or help getting over this final hurdle, I&#8217;m all ears!</p>
<p>Back to the problem. When you add the class <strong>&#8216;s4-nosetwidth&#8217;</strong> to the container with the ID &#8216;<strong>s4-workspace&#8217;, </strong>and then set a fixed width for your container using CSS, this happens;</p>
<p><a title="Ouch, that's not pretty" rel="shadowbox[fwl]" href="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/sp2010-rubbish-scrollbar.png"><img class="size-medium wp-image-76 alignnone" title="sp2010-fixed-width-scrollbar" src="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/sp2010-rubbish-scrollbar-300x173.png" alt="SharePoint 2010 scrollbars look wrong with fixed width layouts" width="300" height="173" /></a></p>
<p>Ouch. That&#8217;s not pretty. Nor is it where your users expect the scrollbar to be, so they won&#8217;t like it either. There are a couple of things you can do here; You could unfloat the ribbon. That way you can use CSS to put the scrollbar back where it should be and your users will feel at home. But, some of the ribbons usefulness is lost. Or  you could add a wrapping container inside the <strong>&#8216;s4-workspace&#8217; </strong>container and then fix the width of that instead. This works but still uses a non standard scrollbar that doesn&#8217;t look quite right.</p>
<p><a title="It's good, but it's not right" rel="shadowbox[fwl]" href="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/sp2010-incorrect-scrollbar.png"><img class="alignnone size-medium wp-image-80" title="sp2010-incorrect-scrollbar" src="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/sp2010-incorrect-scrollbar-300x173.png" alt="The scrollbar is in the right place, but doesn't extend to the top of the window properly" width="300" height="173" /></a></p>
<p>We think there is another way. One that allows the ribbon to float, allows the page to use the scrollbar the user is expecting in the place they are expecting it, and look correct. And in essence it&#8217;s quite simple. Position: fixed to the rescue.</p>
<p>To achieve this you are going to need to edit your master page, have some custom CSS, and some custom javascript. If you can do all these things, then here&#8217;s how it is done. This has been tested as working in IE7 and 8, Firefox 3, Safari 5, and Chrome 6</p>
<ul>
<li>Edit your master page in something like Microsoft Office SharePoint Designer and add the class <strong>&#8216;s4-nosetwidth&#8217;</strong> to the conatiner with the ID &#8216;<strong>s4-workspace&#8217;. </strong>Also remove the attribute <strong>scroll=&#8221;no&#8221;</strong> from the body tag (this is important for IE7). Add your custom CSS, a link to jquery and your custom javascript file references. There are lots of posts around that can explain how best to do this, but some quick example code is below. Make sure your custom css is loaded after the core SharePoint CSS files.</li>
</ul>
<pre class="brush: csharp; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;SharePoint:ScriptLink language=&quot;javascript&quot; name=&quot;&lt;your path&gt;/&lt;your custom js&gt;.js&quot;  runat=&quot;server&quot;/&gt;
&lt;SharePoint:CssRegistration name=&quot;&lt;your path&gt;/&lt;your custom css&gt;.css&quot; After=&quot;corev4.css&quot; runat=&quot;server&quot;/&gt;
</pre>
<ul>
<li>Add the following classes to your CSS file to reset the scrollbar to normal, fix the position of the ribbon, and float it over the items below it.</li>
</ul>
<pre class="brush: css; title: ; notranslate">
/* make the body use it's proper scrollbar again */
body {
overflow: auto !important;
}
/* fix the width of the workspace, centre it and turn off its scrollbar. Also add a default padding to the top to cope with the ribbon in its standard form */
body #s4-workspace {
width: 980px;
margin: 0 auto;
overflow: visible;
padding-top: 44px;
}
/* fix the position of the ribbon, float it above the content and allow it to grow when it's height changes */
body #s4-ribbonrow {
position: fixed;
left: 0;
top: 0;
z-index: 10;
overflow-y: visible;
}
</pre>
<ul>
<li>Almost there. Lastly, we need to add in a bit of custom javascript to cope with the way the ribbon now hides the top of the page, as well as it&#8217;s default behaviors of changing height dynamically and hiding the title row when certain tabs are clicked. There is a method within the core init.js file which we can use to tie our function in to ribbon resizes, and we should use padding rather than margin because IE7 copes with it better, so add the following to your javascript file. Also add your jQuery based timer function here to cope with the popdown positioning issue described above.</li>
</ul>
<pre class="brush: jscript; title: ; notranslate">

// function to reset the top margin to whatever the current height of the ribbon is
function setTopPadding() {
var myElem = document.getElementById('s4-workspace'), newHeight = document.getElementById('s4-ribbonrow').offsetHeight;
myElem.style.paddingTop = newHeight + 'px';
}

function setTopPos() {
 $('.ms-cui-menu, .ms-cui-tooltip').each(function(){
 var newTop = $(this).data('origTop') || $(this).position().top;
 $(this).data('origTop',newTop);
 newTop += $('#s4-ribbonrow').position().top;
 $(this).css({
 top : newTop
 });
 });
 }

// bind top padding reset to ribbon resize event so that the page always lays out correctly.
ExecuteOrDelayUntilScriptLoaded(function () { SP.UI.Workspace.add_resized(setTopPadding); }, &quot;init.js&quot;);

$(document).ready(function(){
 setInterval(setTopPos, 300);
 });
</pre>
<p>And once you have this all together, you end up with this!</p>
<p><a title="Perfect!" rel="shadowbox[fwl]" href="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/sp2010-correct-scrollbar.png"><img class="alignnone size-medium wp-image-82" title="sp2010-correct-scrollbar" src="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/sp2010-correct-scrollbar-300x168.png" alt="" width="300" height="168" /></a></p>
<p>The right scrollbar in the right place looking correct, so it&#8217;s what your users expect with no loss in functionality. It looks right if you fix the width of the ribbon too, which some briefs also require (although there are a whole wealth of issues to consider when doing this in order to cope with the way javascript is used so heavily to customise the ribbon, so be careful and test test test). And there you have it, our better way to scrollbars on fixed width layouts. We would be interested in your thoughts about this option!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpoint0.com/blog/fixed-width-layouts-scrollbar-ribbon-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Sharepoint 2010 &#8211; No right click, open in new tab in IE</title>
		<link>http://www.webpoint0.com/blog/sharepoint-2010-no-right-click-open-in-new-tab-in-ie/</link>
		<comments>http://www.webpoint0.com/blog/sharepoint-2010-no-right-click-open-in-new-tab-in-ie/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 13:19:45 +0000</pubDate>
		<dc:creator>web.0</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[SharePoint design and development]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.webpoint0.com/blog/?p=21</guid>
		<description><![CDATA[Over the past year we&#8217;ve been busy doing sharepoint design and customisation for Content and Code, the UK&#8217;s leading sharepoint solutions company, and Microsoft Worldwide Partner of the Year, getting involved in master pages, themes and designs for some of their clients, and the company itself. If you need this kind of work, contact us. [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Where has open in a new tab gone?" href="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/SharePoint-Right-Click-In-IE_thumb.png" rel="shadowbox"><img class="alignright" title="Where has open in a  new tab gone?" src="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/SharePoint-Right-Click-In-IE_thumb.png" alt="Where has open in a new tab gone?" width="150" height="150" /></a>Over the past year we&#8217;ve been busy doing sharepoint design and customisation for <a href="http://www.webpoint0.com/portfolio.php#pt14">Content and Code</a>, the UK&#8217;s leading sharepoint solutions company, and Microsoft Worldwide Partner of the Year, getting involved in master pages, themes and designs for some of their clients, and the company itself. If you need this kind of work, <a href="/contact.php" rel="contact">contact us.</a></p>
<p><span id="more-21"></span>Recently we&#8217;ve been heavily involved in front end work for some SharePoint 2010 public facing sites, working with the improvements in the new system for outputted html and look and feel customisation. It has been a real learning experience and over the next few weeks we&#8217;ll be sharing some of the tips and tricks we have learnt on the project(s) to try and take the vast improvement that SharePoint 2010 is over 2007, and improve on it yet further for our clients sites. First up, fixing an interface bug in the out of the box current navigation control, that, bizarrely, only affects internet explorer.</p>
<p>In IE, open up a SharePoint 2010 publishing site, using the standard v4 master page, that has some links in the left hand navigation. Now, try right clicking one of those links and choosing to open it in a new tab. You&#8217;ll find you can&#8217;t. The item usually found in the context menu to do this simply isn&#8217;t there.</p>
<p>In order to find out what is causing this and fix it we need to dive in to the CSS for the page. The standard control, when using simple rendering to output nice unordered lists for the menu, also wraps the text inside each link in a couple of additional span tags. These are handily added to allow for additional backgrounds and CSS customisations in the menu. Very helpful, but also the root of our problem. The spans are set in the standard CSS to have a display value of &#8216;block&#8217;, which appears to be causing IE to not understand that the thing inside them is a link, and therefore not offering the options in the context menu! This doesn&#8217;t happen in any other browser. To fix it, simply override the display style for the spans with the classes &#8216;additional-background&#8217; and &#8216;menu-item-text&#8217;, so that it is &#8216;inline&#8217; instead, and suddenly your menu options will re-appear.</p>
<p>A simple fix for an odd problem, probably to do with how IE handles the z-indexing, but one worth knowing. Our client that we were working with when we found this oddity, also wrote a good, detailed post on the subject, beating us to the punch, that you can read <a href="http://www.glynblogs.com/2010/06/no-right-click-in-sharepoint-2010.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpoint0.com/blog/sharepoint-2010-no-right-click-open-in-new-tab-in-ie/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CakePHP: Archive list for your blog</title>
		<link>http://www.webpoint0.com/blog/cakephp-archive-list-blog/</link>
		<comments>http://www.webpoint0.com/blog/cakephp-archive-list-blog/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 13:50:16 +0000</pubDate>
		<dc:creator>web.0</dc:creator>
				<category><![CDATA[Custom web development solutions]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.webpoint0.com/blog/?p=31</guid>
		<description><![CDATA[The site we have recently completed for a new client was built using the rapid development framework CakePHP. While there is an initial learning curve with the naming conventions and methods, once you get them right it makes quickly developing editable web sites a much more pleasant experience. We recommend checking it out. And if [...]]]></description>
			<content:encoded><![CDATA[<p><a title="A monthly archive for your cakephp blog" href="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/bondacademy-archive.png" rel="shadowbox"><img class="alignright" title="A monthly archive  for your cakephp blog" src="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/bondacademy-archive-150x150.png" alt="A monthly archive for your cakephp blog" width="150" height="150" /></a>The site we have recently completed for a new <a href="http://www.webpoint0.com/portfolio.php#pt12" rel="portfolio-pItem0">client</a> was built using the rapid development framework CakePHP. While there is an initial learning curve with the naming conventions and methods, once you get them right it makes quickly developing editable web sites a much more pleasant experience. We recommend <a href="http://cakephp.org/" target="_blank">checking it out</a>. And if you need systems built using this kind of framework, <a href="/contact.php" rel="contact">contact us.</a></p>
<p><span id="more-31"></span>Here&#8217;s a useful and simple method we learned to add a nice little year / month archive list to the blog we built for the client&#8217;s site, using standard cakePHP methods it was easy. If you are new to this, first, we recommend going through the tutorials and documentation on the <a title="cakephp book" href="http://book.cakephp.org" target="_blank">cakePHP</a> site, as they will familiarise you with the terms cake uses, MVC architecture in general and are an excellent resource to get you started.</p>
<p>So, assuming you already have your blog in place, perhaps from the tutorial in the documentation, open the controller file for it, probably named blogs_controller.php in the app/controllers directory, and find the index function for the blog. Inside that function, typically after any recursion setting for the blog (in this example we set it to 0), and before the line where you request your list of blogs, which will probably read like;</p>
<pre class="brush: php; title: ; notranslate">$this-&gt;set('blogs', $this-&gt;paginate());</pre>
<p>You add the following set of code;</p>
<pre class="brush: php; title: ; notranslate">
 $archives = $this-&gt;Blog-&gt;find('all',
 array(
 'fields'=&gt;array('DATE_FORMAT(Blog.modified, \'%Y %M\') AS  dd','count(Blog.id) AS numblogs'),
 'order'=&gt;array('dd DESC'),
 'group'=&gt;array('dd')
 ));
 $this-&gt;set(compact('archives'));
 </pre>
<p>This gets us a list of the blogs, grouped by year and month format in descending order, plus a count of the number of blogs in that group for good measure and a an assist for the front end experience.</p>
<p>Now, in our view file, index.ctp, which you&#8217;ll probably find in the app/views/blogs directory, find the location you want your archive list to appear and add in the following code;</p>
<pre class="brush: php; title: ; notranslate">&lt;?php
 $curr_year = '';
 foreach ($archives as $archive):
 if ($curr_year != substr($archive[0]['dd'],0,4)) {
 if ($curr_year != '') {
 echo '&lt;/ul&gt;';
 echo '&lt;/li&gt;';
 }
 echo '&lt;li&gt;'.substr($archive[0]['dd'],0,4);
 echo '&lt;ul&gt;';
 }
 echo $html-&gt;tag('li',$html-&gt;link(substr($archive[0]['dd'],4).'  ('.$archive[0]['numblogs'].')', array('controller'=&gt;'Blogs',  'action'=&gt;'index', 'date'=&gt;str_replace(' ', '-',  $archive[0]['dd']))));
 $curr_year = substr($archive[0]['dd'],0,4);
 endforeach;
 ?&gt;
 </pre>
<p>Now all you need to do is open your blog index page from your browser and you should have a nicely formatted archive index, which you can style to your hearts content, with a total of that months blogs next to each month that has any.</p>
<p>We hope this was useful, more cakePHP tips soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpoint0.com/blog/cakephp-archive-list-blog/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Magento: Add grouped products price table to category view</title>
		<link>http://www.webpoint0.com/blog/magento-add-grouped-products-price-table-to-category-view/</link>
		<comments>http://www.webpoint0.com/blog/magento-add-grouped-products-price-table-to-category-view/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 15:47:41 +0000</pubDate>
		<dc:creator>web.0</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Magento design and development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.webpoint0.com/blog/?p=29</guid>
		<description><![CDATA[Here&#8217;s a useful tip we learnt recently on a project for a client. How to add the component parts of a grouped product to a catalog list page and make them purchasable right from there. This is confirmed working in Magento 1.4. The important thing about this solution is is does not require any core [...]]]></description>
			<content:encoded><![CDATA[<p><a title="grouped products in a category listing" rel="shadowbox" href="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/grouped-products-cat-list.png"><img class="alignright" title="grouped products in a category listing" src="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/grouped-products-cat-list-150x150.png" alt="grouped products in a category listing" width="150" height="150" /></a>Here&#8217;s   a useful tip we learnt recently on a project for a client. How to add   the component parts of a grouped product to a catalog list page and  make  them purchasable right from there. This is confirmed working in  Magento  1.4. The important thing about this solution is is does not  require  any core code to be over-ridden, we can do it right from the  template,  so no worries about core code updates over-riding our stuff.  But, for  the sake of saying it, don&#8217;t do ANYTHING without ensuring you  have a  working backup and are not overwriting core files first. Enter  at your  own risk and all that.</p>
<p><span id="more-29"></span>The first  thing you should do is go in to the admin system for your   magento  installation and set the category lists to only show in list   view, not  grid, as obviously putting this kind of table in a grid view   somewhat  messes up the layout. However, needs must.</p>
<p>To achieve the goal we need to edit two template files. So, according   to Magento best practice grab the following two files from the default   them and copy them in to your custom theme folder, replacing   &#8216;your_package&#8217; and &#8216;your_theme&#8217; with your installation&#8217;s names as   follows:</p>
<ol>
<li>/app/design/frontend/your_package/your_theme/template/catalog/product/view/type/grouped-list.phtml</li>
<li>/app/design/frontend/your_package/your_theme/template/catalog/product/list.phtml</li>
</ol>
<p>Next, open up the list.phtml file, and inside the div with the class   &#8216;product-shop&#8217;, find the three lines of code that read;</p>
<pre class="brush: php; title: ; notranslate">&lt;?php if($_product-&gt;getRatingSummary()): ?&gt;
&lt;?php echo $this-&gt;getReviewsSummaryHtml($_product) ?&gt;
&lt;?php endif; ?&gt;</pre>
<p>Just after these lines (they end at line 54 in our file, but yours   may vary), add the following code chunk;</p>
<pre class="brush: php; title: ; notranslate">&lt;?php if ($_product-&gt;isGrouped()): ?&gt;
&lt;form  id=&quot;&lt;?php echo 'productListForm'.$_product-&gt;getId(); ?&gt;&quot;  action=&quot;&lt;?php echo $this-&gt;getAddToCartUrl($_product) ?&gt;&quot;  method=&quot;post&quot; &lt;?php if($_product-&gt;getOptions()): ?&gt;  enctype=&quot;multipart/form-data&quot;&lt;?php endif; ?&gt;&gt;
&lt;?php echo   $this-&gt;setTemplate('catalog/product/view/type/grouped-list.phtml')-&gt;setProduct($_product)-&gt;toHtml();  ?&gt;
&lt;?php if($_product-&gt;isSaleable()): ?&gt;
&lt;p&gt;&lt;button type=&quot;button&quot; title=&quot;&lt;?php echo $this-&gt;__('Add  to Cart') ?&gt;&quot; onclick=&quot;&lt;?php echo  'productListForm'.$_product-&gt;getId().'.submit()';  ?&gt;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;?php echo $this-&gt;__('Add to  Cart') ?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;/p&gt;
&lt;?php else: ?&gt;
&lt;p&gt;&lt;span&gt;&lt;?php echo  $this-&gt;__('Out of stock') ?&gt;&lt;/span&gt;&lt;/p&gt;
&lt;?php  endif; ?&gt;
&lt;/form&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
//&lt;![CDATA[
var &lt;?php echo  'productListForm'.$_product-&gt;getId(); ?&gt; = new  VarienForm('&lt;?php echo 'productListForm'.$_product-&gt;getId();  ?&gt;');
&lt;?php echo 'productListForm'.$_product-&gt;getId();  ?&gt;.submit = function(){
if (this.validator.validate()) {
this.form.submit();
}
}.bind(&lt;?php echo  'productListForm'.$_product-&gt;getId(); ?&gt;);
//]]&gt;
&lt;/script&gt;
&lt;?php else: ?&gt;
&lt;?php echo  $this-&gt;getPriceHtml($_product, true) ?&gt;
&lt;?php  if($_product-&gt;isSaleable()): ?&gt;
&lt;p&gt;&lt;button  type=&quot;button&quot; title=&quot;&lt;?php echo $this-&gt;__('Add to Cart') ?&gt;&quot;
onclick=&quot;setLocation('&lt;?php echo  $this-&gt;getAddToCartUrl($_product) ?&gt;')&quot;&gt;
&lt;span&gt;&lt;span&gt;&lt;?php echo $this-&gt;__('Add to Cart')  ?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;/p&gt;
&lt;?php  else: ?&gt;
&lt;p&gt;&lt;span&gt;&lt;?php echo $this-&gt;__('Out of  stock') ?&gt;&lt;/span&gt;&lt;/p&gt;
&lt;?php endif; ?&gt;
&lt;?php endif; ?&gt;</pre>
<p>Then, open the grouped.phtml file and edit the last line of the file   that reads;</p>
<pre class="brush: jscript; title: ; notranslate">&lt;script  type=&quot;text/javascript&quot;&gt;decorateTable('super-product-table')&lt;/script&gt;</pre>
<p>and change it to read;</p>
<pre class="brush: jscript; title: ; notranslate">&lt;script  type=&quot;text/javascript&quot;&gt;decorateTable('super-product-table&lt;?php  echo $_product-&gt;getId(); ?&gt;')&lt;/script&gt;</pre>
<p>Save  your two files, copy them in to your custom folder tree in the  right  spots, create some grouped products and you&#8217;re done! Grouped  products  that can be purchased right from the category list page.</p>
<p>More Magento tips soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpoint0.com/blog/magento-add-grouped-products-price-table-to-category-view/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>about this site</title>
		<link>http://www.webpoint0.com/blog/about-this-site/</link>
		<comments>http://www.webpoint0.com/blog/about-this-site/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 10:10:49 +0000</pubDate>
		<dc:creator>web.0</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Javascript, AJAX and jQuery]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Progressive enhancement]]></category>

		<guid isPermaLink="false">http://www.webpoint0.com/blog/?p=8</guid>
		<description><![CDATA[Progressive enhancement has become a buzzword of late in front end web development, and is about taking a set of web pages, and first making them work for everybody, right down to web crawlers, then adding pieces on top using css and javascript to enhance the user experience. If you were to look at this [...]]]></description>
			<content:encoded><![CDATA[<p><a title="How the old site looked" rel="shadowbox" href="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/old-site-grab.png"><img class="alignright" title="How the old site looked" src="http://www.webpoint0.com/blog/wp-content/uploads/2010/09/old-site-grab-150x150.png" alt="How the old site looked" width="150" height="150" /></a>Progressive   enhancement has become a buzzword of late in front end web development,   and is about taking a set of web pages, and first making them work for   everybody, right down to web crawlers, then adding pieces on top using   css and javascript to enhance the user experience.</p>
<p><span id="more-8"></span>If you were   to look at this site in a browser with all css and javascript turned   off, it would look like a set of text documents, but still work, which   search engines like. We then add css on top of this that is tailored to   make the pages look the same across all browsers, and attractive, which   our visitors (hopefully) like. Lastly, we layer a set of javascript   functions utilising the jQuery javascript library on top, that further   enhance the experience. We load our pages via AJAX, so only the content   that changes on each page is loaded, increasing the speed. We add  custom  histories to the visitors browser, which allows them to still  use the  back button they are used to, and we add special effects to the   portfolio, to make it a richer user experience. This final layer gives   the site its best look.</p>
<p>Therefore however the visitor likes to surf the web, be they human or   machine, they get the best experience tailored for them.</p>
<p><strong>UPDATE (July 2010):</strong> In adding this WordPress blog to the site,  we&#8217;ve  learnt a lot about ajax-ifying a wordpress blog. The short  answer is it  is tricky, and has prompted a project to redesign the  site, possible  using other techniques to speed up page loading (and  also because we  like the idea of an updated look). We&#8217;ll keep this site  somewhere if we  can for reference when the new one goes live, but for  now, this is how  we did it;</p>
<p>We use a jquery function once the page has loaded to hijack all the a   tags in the page that we are looking for, like so;</p>
<pre class="brush: jscript; title: ; notranslate">
$('#main a').each(function() {
if ((!$(this).hasClass('comment-reply-link')) &amp;&amp;  (!$(this).hasClass('non-blog'))) {
$(this).addClass('ajaxlink').attr('rel','blog-'+$(this).attr('href'));
}
});&lt;/code&gt;&lt;code&gt;</pre>
<p>We exclude the comment reply links, and any internal links to   non-blog pages via the hasClass method, as we handle and ajax-ify those   in a different way. The function adds an additional class to all the a   tags in our page that are not comment reply links, adds the url we  would  want loaded if a visitor clicked that link and then passes off to  the  main page load function that runs throughout the rest of the site.  This  avoids us having to mess around with the wordpress templates and  means  if the visitor has javascript turned off, everything still works.</p>
<p>The main page load function then adds an event listener to all a tags   within the entire page that have the class &#8216;ajaxlink&#8217;. This hijacks  the  link click event, and loads the central section of the page using  an  xmlhttp request instead, so we only bring back the central page  content,  and the header and footer do not require reloading. We then  use the  jQuery history plugin to add the page requested to the hash in  the  visitors browser, so if they click back they end up back in the  right  place in there browser history. Thus improving page load times  and  giving that one-page feel to the blog that the rest of the site  already  has.</p>
<p>For the comments, we hijack those links in a different way, adding an   additional hidden field to the built in form, and editing the  wordpress  file wp-comments-post.php, to make it able to understand if  we have  sent our comment via ajax or via a standard form post. It only  requires a  small code change in this file, changing the final line  from;</p>
<pre class="brush: php; title: ; notranslate">wp_redirect($location);</pre>
<p>to;</p>
<pre class="brush: php; title: ; notranslate">if (isset($_POST['ajaxsubmission'])) {
echo('location='.$location);
} else {
wp_redirect($location);
}</pre>
<p>This makes the comments post process return the location we want to   load as a response, rather than a redirect when the form is posted via   ajax, handing off the location back to the custom page loading function,   so we can then load the new page along with the comment in the same   progressively enhanced way.</p>
<p>And that&#8217;s how we did it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpoint0.com/blog/about-this-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

