<?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>Microsoft Sharepoint Server &#187; Lightbox</title>
	<atom:link href="http://www.fivenumber.com/tag/lightbox/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fivenumber.com</link>
	<description>It&#039;s all about SharePoint</description>
	<lastBuildDate>Fri, 28 May 2010 09:21:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
<link>http://www.fivenumber.com</link>
<url>http://www.fivenumber.com/wp-content/mbp-favicon/5.jpg</url>
<title>Microsoft Sharepoint Server</title>
</image>
		<item>
		<title>Lightbox enabled custom webpart, displays images from sharepoint picture library</title>
		<link>http://www.fivenumber.com/lightbox-enabled-custom-webpart-displays-images-from-sharepoint-picture-library/</link>
		<comments>http://www.fivenumber.com/lightbox-enabled-custom-webpart-displays-images-from-sharepoint-picture-library/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 12:52:47 +0000</pubDate>
		<dc:creator>GVK</dc:creator>
				<category><![CDATA[MOSS - Object Model]]></category>
		<category><![CDATA[Custom Webparts]]></category>
		<category><![CDATA[Lightbox]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Webparts]]></category>

		<guid isPermaLink="false">http://www.fivenumber.com/?p=429</guid>
		<description><![CDATA[Here is the simple Lightbox enabled custom webpart which displays the images from sharepoint picture library.
Instructions to use:

Download Lightbox
After downloading, copy all the Lightbox files or folders to sharepoint 2007 website using sharepoint designer 2007.
Add the lightbox javascript and css reference tags in the head section of sharepoint site master page.


Create a Picture Library in [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the simple Lightbox enabled custom webpart which displays the images from sharepoint picture library.</p>
<div id="attachment_428" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2008/10/110.gif" rel="lightbox[429]"><img class="size-medium wp-image-428" title="110" src="http://www.fivenumber.com/wp-content/uploads/2008/10/110-300x95.gif" alt="Lightbox enabled webpart" width="300" height="95" /></a><p class="wp-caption-text">Lightbox enabled webpart</p></div>
<p><strong>Instructions to use</strong>:</p>
<ul>
<li>Download <a title="Lightbox 2" href="http://www.huddletogether.com/projects/lightbox2/" target="_blank">Lightbox</a></li>
<li>After downloading, copy all the Lightbox files or folders to sharepoint 2007 website using sharepoint designer 2007.</li>
<li>Add the lightbox javascript and css reference tags in the head section of sharepoint site master page.</li>
</ul>
<div id="attachment_430" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2008/10/22.gif" rel="lightbox[429]"><img class="size-medium wp-image-430" title="Add Lightbox reference tags" src="http://www.fivenumber.com/wp-content/uploads/2008/10/22-300x178.gif" alt="Add Lightbox reference tags" width="300" height="178" /></a><p class="wp-caption-text">Add Lightbox reference tags</p></div>
<ul>
<li>Create a Picture Library in sharepoint site naming <strong>Picture Library</strong> (you can also give any other name, but make sure to change the name in the downloaded source code too) upload few pictures to the library.</li>
<li>Create a webpart using visual studio, copy and paste the <a title="Lightbox Enabled Custom Webpart" href="http://www.fivenumber.com/wp-content/uploads/2008/10/lightbox-enabled-custom-webpart3.txt" target="_blank">source code</a>, build and import the webpart to sharepoint site.</li>
</ul>
<p>Finally looks like this when you click on  a image</p>
<div id="attachment_432" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2008/10/36.gif" rel="lightbox[429]"><img class="size-medium wp-image-432" title="Lightbox enabled custom webpart" src="http://www.fivenumber.com/wp-content/uploads/2008/10/36-300x191.gif" alt="Lightbox enabled custom webpart" width="300" height="191" /></a><p class="wp-caption-text">Lightbox enabled custom webpart</p></div>
<p><a title="Lightbox - download the complete source code" href="http://www.fivenumber.com/wp-content/uploads/2008/10/lightbox-enabled-custom-webpart3.txt" target="_blank">Download the complete source code</a></p>
<pre name="code" class="c-sharp">
using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;

using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;

namespace NewLightBox
{
    [Guid("148b47a8-0e84-423d-bb3f-44e5f2e33dea")]
    public class NewLightBox : System.Web.UI.WebControls.WebParts.WebPart
    {
        protected override void Render(HtmlTextWriter writer)
        {
            SPSite mysite = new SPSite("http://" + System.Environment.MachineName);
            mysite = SPControl.GetContextSite(Context);
            SPWeb myweb = mysite.OpenWeb();
            myweb = SPControl.GetContextWeb(Context);
            SPList mylist = myweb.Lists["Picture Library"];
            SPQuery myquery=new SPQuery();
            myquery.Query="";
            string path = mysite.ServerRelativeUrl.ToString() + "Picture Library/";
            SPListItemCollection mylstcol = mylist.GetItems(myquery);
            if (mylstcol.Count > 0)
            {
                foreach (SPListItem mylstitem in mylstcol)
                {
                    writer.Write("<a href='" + path + mylstitem["Name"].ToString() + "' rel='lightbox[PictureGroup]' title='" + mylstitem["Title"].ToString() + "'>");
                    writer.Write("<img src='" + path + mylstitem["Name"].ToString() + "' width='100px' height='75px' border='0'/>");
                    writer.Write("</a>&nbsp;");
                }
            }
            else
            {
                this.Page.Response.Write("No image found");
            }
            // TODO: add custom rendering code here.
            // writer.Write("Output HTML");
        }
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fivenumber.com/lightbox-enabled-custom-webpart-displays-images-from-sharepoint-picture-library/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
