<?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>The Knowledge Supply Chain &#187; Websites</title>
	<atom:link href="http://www.ipov.net/apps/blog/category/websites/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ipov.net/apps/blog</link>
	<description></description>
	<lastBuildDate>Fri, 17 Jun 2011 21:52:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Drupal 6 Ajax Screenshot Gallery</title>
		<link>http://www.ipov.net/apps/blog/2009/09/drupal-6-ajax-screenshot-gallery/</link>
		<comments>http://www.ipov.net/apps/blog/2009/09/drupal-6-ajax-screenshot-gallery/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 15:06:24 +0000</pubDate>
		<dc:creator>robert.sanders</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://www.ipov.net/blog/?p=112</guid>
		<description><![CDATA[We recently wanted to put up a carousel-style image gallery of product screenshots in our Drupal based website. After a good bit of research, I wound up with several “solutions”, but none of them did quite what I wanted; luckily I hit upon a solution by a bit of good luck simply by noticing some [...]]]></description>
			<content:encoded><![CDATA[<p>We recently wanted to put up a carousel-style image gallery of product screenshots in our Drupal based website.  After a good bit of research, I wound up with several “solutions”, but none of them did quite what I wanted; luckily I hit upon a solution by a bit of good luck simply by noticing some settings that had been enabled in the course of trying out some of the existing plugins.<br />
<span id="more-112"></span></p>
<p>Before getting into my solution, I&#8217;ll mention the two modules that are closest to what I want to achieve:</p>
<ol>
<li><span><a href="http://drupal.org/project/galleria" target="_blank">Galleria </a>– this module produces 	a carousel-style listing of image thumbnails, when a thumbnail is 	clicked on the full-size image is shown.  However, this module has the following problems for my use case:</span>
<ol>
<li>The thumbnails are simply the 		original image file with an explicit width and height set; this 		means that if you have a lot of them, it can take quite a while for 		them all to load.</li>
<li>Loading is not actually 		asynchronous, but there is a significant delay while the javascript 		initializes during which the content is hidden.  There is no 		progress indicator during this time.</li>
<li>The admin panel for the module 		has very limited options – the worst is that it doesn&#8217;t let you 		set the size of the carousel (which can be overridden in CSS), but 		does ask you to specify how many images to display – the images 		are scaled (using CSS) to fit in the carousel&#8217;s default size (you 		can hack the JS code to fix this, but then have to reset a number 		of other CSS properties).</li>
</ol>
</li>
<li><a href="http://drupal.org/project/fancy_slide" target="_blank">Fancy Slide </a>- this module seems 	to  be very new and as such has pretty much no documentation.  If 	its development continues it could become a viable alternative to my 	needs. The biggest problem with this module currently is lack of 	control over the presentation.</li>
</ol>
<p>The following solution uses existing modules.  It seems logical that this technique is already out there, but as I can&#8217;t find it documented, I&#8217;m doing that here.  The main modules you&#8217;ll need:</p>
<ul>
<li><a href="http://drupal.org/project/imageapi">ImageAPI</a></li>
<li><a href="http://drupal.org/project/imagecache">ImageCache</a></li>
<li><a href="http://drupal.org/project/cck">CCK</a>, <a href="http://drupal.org/project/cck">CCK Filefield</a>, <a href="http://drupal.org/project/imagefield">CCK Imagefield</a></li>
<li><a href="http://drupal.org/project/views">Views</a></li>
<li><a href="http://drupal.org/project/thickbox">Thickbox </a>-   for some reason the 	latest version of the Lightbox2 module is creating JS errors when 	mixed with the lastest JQuery version.</li>
</ul>
<p>After installing the modules listed above here&#8217;s what you do:</p>
<div>
<h4>Admin &gt; Site Building &gt; ImageCache</h4>
<p style="padding-left: 30px;">Add a preset, in my case “medium_thumbnail” which is a simple Scale to 128&#215;128 pixels.</p>
</div>
<div>
<h4>Admin &gt; Content Management &gt; Content types</h4>
<div>
<p>Add a new node content type, I called mine “Screenshot.”  There is no need for the “Body.”  Once the basic node type is added go to “Manage Fields” and add the following:</p>
<p>An Image field for the screen shot.  When configuring it enable the “Title text settings” set its input type to textarea (no default value).  Disable the “Description field.”</p>
<ul>
<li>Label: Screenshot</li>
<li>Name:  field_screen  (doesn&#8217;t 	really mater)</li>
<li>Type: File</li>
<li>Form Element: Image</li>
</ul>
<p>The “Screen Gallery” field is my way of organizing multiple galleries.  It may be more correct to use Taxonomy, but this keeps the settings in one place which I like.  You need to add at least one entry in the list of acceptable values.  Please feel free to write me if you think using Taxonomy or another approach is better.</p>
<ul>
<li>Label:  Screen Gallery</li>
<li>Name:  field_gallery</li>
<li>Type: Text</li>
<li>Form Element Select</li>
</ul>
<p>Finally, the Sort Order.  If I have time I may experiment with the Nodequeue module in an attempt to replace this, but for now this provides a way to order the screenshots.  If we use a decimal , and then enter “Integers” (1.0, 2.0) this will leave us room to insert new screenshots between existing ones.</p>
<ul>
<li>Label:  Sort Order</li>
<li>Name:  field_order</li>
<li>Type:  Decimal,  precision = 12 ,  	scale = 2</li>
<li>Form Element:  Text</li>
</ul>
</div>
</div>
<p>At this point you probably want to create one or two Screenshot nodes so that you have something to look at while building the view.  Go to “Create content” &gt; Screenshot.  Enter the Node Title.  Scroll down to the “Screenshot” field and upload an image file; once it has uploaded you should get a “Title” field next to the file where you can enter a description (note that entering HTML here probably won&#8217;t work too well as the contents of this field are output as an attribute).</p>
<p>Now for the final part: creating a View.  Go to  <strong>Admin &gt; Site building &gt; Views</strong> and  “Add.”  Use the settings:</p>
<div style="padding-left: 30px;">
<ul>
<li><span>Type: Grid   &#8211; you could probably 	also use table, etc., but Grid works for me.  Size the width to 	whatever size is going to work for your content.   You may need to 	create a CSS entry to add some padding to the grid cells  e.g.</span>
<div style="font-family:Courier New;">
<div>.views-view-grid td {</div>
<div>padding: 0.8em;</div>
<div>}</div>
</div>
</li>
<li>Row Style:  Fields</li>
<li>Since I have a limited number of 	images, I set, Use Pager: No,  Items to display:  Unlimited.</li>
<li>Filters:
<ul>
<li>Node: Published = Yes</li>
<li>Node: Type = Screenshot</li>
<li>Content: Screen Gallery 		(field_gallery) and then set the “name” of the gallery from one 		of the allowed values you entered in the CCK list.</li>
</ul>
</li>
<li>Sort criteria:
<ul>
<li>Content: Sort Order asc</li>
</ul>
</li>
<li>Fields:
<ul>
<li>Content: Screenshot = Thickbox: 		medium_thumbnail image   &#8211; this option is only available if you&#8217;ve 		installed Thickbox and set at least one ImageCache setting.</li>
<li>Node: Title    &#8211; this will 		display the title of the Node (not the image title) directly under 		the thumbnail.</li>
</ul>
</li>
</ul>
<p>Now save the View.  Mine is called “ccs_screens”, so I can embed it into a Page Node using</p>
<div style="font-family:Courier New;">
<div>&lt;?php</div>
<div>$view = views_get_view(&#8216;ccs_screens&#8217;);</div>
<div>print $view-&gt;execute_display(&#8216;default&#8217;, $args);</div>
<div>?&gt;</div>
</div>
</div>
<p>That&#8217;s it.  You can see our screenshots page at <a href="../../content/cosolvent-screenshots-0">http://www.ipov.net/content/cosolvent-screenshots-0</a></p>
<p>If I have time I&#8217;ll also setup a quick screencast and update this post with a link to it.</p>
<div class="printfriendly alignleft"><a href="http://www.ipov.net/apps/blog/2009/09/drupal-6-ajax-screenshot-gallery/?pfstyle=wp" rel="nofollow" ><img src="//cdn.printfriendly.com/pf-button.gif" alt="Print Friendly" /></a></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ipov.net%2Fapps%2Fblog%2F2009%2F09%2Fdrupal-6-ajax-screenshot-gallery%2F&amp;title=Drupal%206%20Ajax%20Screenshot%20Gallery" id="wpa2a_2"><img src="http://www.ipov.net/apps/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ipov.net/apps/blog/2009/09/drupal-6-ajax-screenshot-gallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

