<?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>Idealien Studios &#187; Tutorials</title>
	<atom:link href="http://idealienstudios.com/category/blog/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://idealienstudios.com</link>
	<description>We will turn your dreams into reality together!</description>
	<lastBuildDate>Mon, 19 Jul 2010 05:59:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Template &#8211; Retail Locations</title>
		<link>http://idealienstudios.com/blog/wordpress/template-retail-locations/</link>
		<comments>http://idealienstudios.com/blog/wordpress/template-retail-locations/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 13:36:06 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[ICE]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://idealienstudios.com/?p=647</guid>
		<description><![CDATA[Learn how to capture and display custom fields in a template using <a title="More Fields" href="http://wordpress.org/extend/plugins/more-fields/">More Fields</a>, a plugin that "enables you to define post types, which are custom Write/Edit pages that contains a pre-defined set of boxes"]]></description>
			<content:encoded><![CDATA[<div id="attachment_648" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-648" title="Retail Locations" src="http://idealienstudios.com/wp-content/uploads/projects_ice_09july9_retail-300x200.jpg" alt="Capture and display custom data types" width="300" height="200" /><p class="wp-caption-text">Capture and display custom data types using ICE and More Fields</p></div>
<p>Building on the concept of category templates which I started with the <a title="FAQ template tutorial" href="http://idealienstudios.com/projects/ice/template-demo-faq/">FAQ template tutorial</a> last week, this tutorial will cover how to capture and display custom fields in a template. What&#8217;s more, I&#8217;ll go through the step-by-step process of how to implement this using <a title="More Fields" href="http://wordpress.org/extend/plugins/more-fields/">More Fields</a> which is a plugin that &#8220;enables you to define post types, which are custom Write/Edit pages that contains a pre-defined set of boxes&#8221; that store their data behind the scenes in custom fields. The concepts from this tutorial will be of interest for anyone who:</p>
<ul>
<li>Has multiple categories of blog content with unique data to capture / present. Thumbnail per post, photo of the day or other customized items.</li>
<li>Uses WordPress as a CMS for unique page data types (event calendar, classified ads, business partners, etc)</li>
<li>Finds the selection of custom fields from a drop-down to not be the best user interface experience for capturing structured data.</li>
</ul>
<p><object width="590" height="346"><param name="movie" value="http://content.screencast.com/users/Idealien/folders/ICE/media/98b832dc-fc7e-4d98-8ac7-d60e39ccfb18/flvplayer.swf"></param><param name="quality" value="high"></param><param name="bgcolor" value="#FFFFFF"></param><param name="flashVars" value="thumb=http://content.screencast.com/users/Idealien/folders/ICE/media/98b832dc-fc7e-4d98-8ac7-d60e39ccfb18/FirstFrame.jpg&#038;containerwidth=590&#038;containerheight=346&#038;content=http://content.screencast.com/users/Idealien/folders/ICE/media/98b832dc-fc7e-4d98-8ac7-d60e39ccfb18/ICEMoreFields.mp4"></param><param name="allowFullScreen" value="true"></param><param name="scale" value="showall"></param><param name="allowScriptAccess" value="always"></param><param name="base" value="http://content.screencast.com/users/Idealien/folders/ICE/media/98b832dc-fc7e-4d98-8ac7-d60e39ccfb18/"></param>  <embed src="http://content.screencast.com/users/Idealien/folders/ICE/media/98b832dc-fc7e-4d98-8ac7-d60e39ccfb18/flvplayer.swf" quality="high" bgcolor="#FFFFFF" width="590" height="346" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/Idealien/folders/ICE/media/98b832dc-fc7e-4d98-8ac7-d60e39ccfb18/FirstFrame.jpg&#038;containerwidth=590&#038;containerheight=346&#038;content=http://content.screencast.com/users/Idealien/folders/ICE/media/98b832dc-fc7e-4d98-8ac7-d60e39ccfb18/ICEMoreFields.mp4" allowFullScreen="true" base="http://content.screencast.com/users/Idealien/folders/ICE/media/98b832dc-fc7e-4d98-8ac7-d60e39ccfb18/" scale="showall"></embed></object></p>
<p>Direct Video Link:<a href="http://www.screencast.com/t/2dcpYsSlk">http://www.screencast.com/t/2dcpYsSlk</a></p>
<h2>Example Code</h2>
<p>The only real code in this template that is unique is the retrieval of data from a <a href="http://codex.wordpress.org/Using_Custom_Fields">custom field</a> using the <a href="http://codex.wordpress.org/Function_Reference/get_post_meta">get_post_meta</a> function.</p>
<p><strong>A single custom field retrieval</strong><br />
Place this example within the loop of an existing category / post template.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$locationPhone</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'locationPhone'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$locationPhone</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;div class=&quot;locationInfo&quot;&gt;
		&lt;h4&gt;Phone Number&lt;/h4&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span>  <span style="color: #000088;">$locationPhone</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><strong>Full retail location fields</strong><br />
This example is the full loop for use within a category.php file to display the contents of custom fields named: location</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	&lt;h2&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h2&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$locationAddress</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'locationAddress'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$locationAddress</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;div class=&quot;locationInfo&quot;&gt;
			&lt;h4&gt;Address&lt;/h4&gt;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$locationMapURL</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'locationMapURL'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$locationMapURL</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">echo</span>  <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$locationMapURL</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;'&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span>  <span style="color: #000088;">$locationAddress</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$locationMapURL</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;/div&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$locationPhone</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'locationPhone'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$locationPhone</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;div class=&quot;locationInfo&quot;&gt;
			&lt;h4&gt;Phone Number&lt;/h4&gt;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span>  <span style="color: #000088;">$locationPhone</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;/div&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$locationHours</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'locationHours'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$locationHours</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;div class=&quot;locationInfo&quot;&gt;
			&lt;h4&gt;Business Hours&lt;/h4&gt;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span>  <span style="color: #000088;">$locationHours</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;/div&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$locationWebsite</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'locationWebsite'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$locationWebsite</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;div class=&quot;locationInfo&quot;&gt;
			&lt;h4&gt;Website&lt;/h4&gt;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span>  <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$locationWebsite</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;'&gt;&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$locationWebsite</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;/div&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	&lt;p&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Sorry, no posts matched your criteria.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://idealienstudios.com/blog/wordpress/template-retail-locations/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Share your plugins on WordPress.org</title>
		<link>http://idealienstudios.com/blog/tutorials/share-your-plugin-on-wordpress/</link>
		<comments>http://idealienstudios.com/blog/tutorials/share-your-plugin-on-wordpress/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 17:02:28 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://idealienstudios.com/?p=233</guid>
		<description><![CDATA[Wordpress 2.7 offers direct download of plugins from the Plugin Repository. This tutorial shows you how to maintain a plugin code on the Wordpress repository using Dreamweaver.]]></description>
			<content:encoded><![CDATA[<p>Are you comfortable building plugins for WordPress? Have you made some for personal (or paying) projects that would be useful to others? Did you know that WordPress 2.7 offers direct download of plugins from the Plugin Repository? Think of how much traffic that could build compared to all those blog comments you&#8217;ve written. I&#8217;m starting to hear your thoughts of &#8220;I need to get me some of that plugin repository action!&#8221;.  You&#8217;ve come to the right place to learn.</p>
<p>A repository is just a fancy way for saying a place to store your data much like an FTP server. What makes using one so important is that you create versions of files so that you can always roll back if you make mistakes. The WordPress.org site contains some very good information on <a title="How To Use Subversion" href="http://wordpress.org/extend/plugins/about/svn/">How To Use Subversion</a> to create / contribute to a plugin&#8230;if you are a fan of command line tools. Some people probably prefer that approach &#8211; just like using vi as a text editor. However, I find graphical based user interfaces easier and more efficient to use.</p>
<p>This tutorial is for those who &#8211; like me &#8211; use Dreamweaver for web development and want to maintain their plugin code on the WordPress repository through it. For those who use <a title="Eclipse" href="http://www.eclipse.org/">Eclipse</a>, you can follow a similar process using <a title="SubClipse" href="http://subclipse.tigris.org/">SubClipse</a>. The two key pieces of the puzzle are:</p>
<ul>
<li><a title="TortoiseSVN" href="http://tortoisesvn.tigris.org/">TortoiseSVN</a> &#8211; An SVN client for Windows that makes version management simple.</li>
<li><a title="Subweaver" href="http://code.google.com/p/subweaver/">SubWeaver</a> &#8211; A Dreamweaver extension to integrate SVN commands through Tortoise.</li>
</ul>
<p><strong></strong></p>
<h3><span id="more-233"></span>Setup your WordPress.org account and plugin repository</h3>
<p>The first thing you will want to do is go to WordPress.org &gt; Extend &gt; Plugins and <a title="Register on WordPress.org" href="http://wordpress.org/extend/plugins/register.php">register for an account</a>. The contact information (name, email, website, etc) you provide will show up with any plugins that you create or contribute to.</p>
<p>Since you&#8217;re on the site and ready to start your first plugin, go to the <a title="Add A Plugin" href="http://wordpress.org/extend/plugins/add/">Add a Plugin form</a> and provide the appropriate details (name, description, url). Note that it may take 24 &#8211; 48 hours for your plugin request to be approved, but this will create a new repository for your plugin.</p>
<h3>Install Tortoise and SubWeaver</h3>
<p>Download and install Tortoise SVN from <a href="http://tortoisesvn.tigris.org">http://tortoisesvn.tigris.org</a>. You will have to restart your computer for the changes to take effect.  After that has completed, you will want to download and install Subweaver from <a title="SubWeaver" href="http://code.google.com/p/subweaver/">http://code.google.com/p/subweaver/</a></p>
<p>When you are looking at the file explorer in Dreamweaver, you will now see a new SubWeaver sub-menu that I will explain the primary uses of it as we go along.</p>
<h3>Create a local repository</h3>
<p><a href="http://idealienstudios.com/wp-content/uploads/blog_svnpluginintro_checkout.jpg"><img class="alignright size-thumbnail wp-image-234" title="Checking Out ICE" src="http://idealienstudios.com/wp-content/uploads/blog_svnpluginintro_checkout-150x150.jpg" alt="Checking Out ICE" width="150" height="150" /></a>You will need a folder on your hard drive to store the plugin files / folders. Find the folder in Windows Explorer and right-click on it to select SVN Checkout. You will have to add the repository information which was specified when you completed the Add a Plugin form. The repository path should start with http://svn.wp-plugins.org/ as the image at right shows for <a title="ICE" href="http://www.idealienstudios.com/code/ice/">Idealien Category Enhancements</a>.</p>
<p>You could do this through Dreamweaver directly, however I prefer to do the initial checkout by Tortoise so that when I create the site in Dreamweaver it already contains the standard SVN structure.</p>
<h3>Understanding the structure of a repository</h3>
<p><img class="size-full wp-image-246 alignright" title="Repository directory structure" src="http://idealienstudios.com/wp-content/uploads/blog_svnpluginintro_structure.jpg" alt="Repository directory structure" width="240" height="200" />There are 3 different locations where you can place code which are loosely based on the analogy of a tree:</p>
<ul>
<li><strong>Trunk </strong>represents the area where your active development goes. When starting your plugin, it will be where you add your first files. It is the <em>latest and greatest</em> so might not be ready for public consumption.</li>
<li><strong>Tags</strong> are for specific versions of your plugin. Any time you commit significant changes to your trunk (i.e. a new version) you should create a new tag and update the <a title="Plugin Readme.txt" href="http://wordpress.org/extend/plugins/about/">readme.txt file</a> to indicate what the newest release is. I have gotten into the habit of developing on a separate WP installation (easier for testing, debug, etc) and as a result the code in the trunk usually mirrors the most up to date tag available.</li>
<li><strong>Branches</strong> are for working on enhancements or code you would like others to beta test or build in isolation of other functionality. When you&#8217;re satisfied with a particular branch, you will have to merge the changes into the trunk. Smaller scope plugins usually won&#8217;t use branches.</li>
</ul>
<p>Or as the wordpress.org site puts it:</p>
<blockquote><p>Each time you make a formal release of your plugin, you should tag a copy of that release&#8217;s code. This lets your users easily grab the latest (or an older) version, it lets you keep track of changes more easily, and lets the WordPress.org Plugin Directory know what version of your plugin it should tell people to download.</p></blockquote>
<h3>Add, Modify, Delete or just Commit!</h3>
<p><a href="http://idealienstudios.com/wp-content/uploads/blog_svnpluginintro_commit2.jpg"><img class="size-medium wp-image-245 alignright" title="Committing updates" src="http://idealienstudios.com/wp-content/uploads/blog_svnpluginintro_commit2-300x136.jpg" alt="Committing updates" width="300" height="136" /></a>You now have a link between the repository and your local computer. Work with the files on your local PC until you are satisfied and ready to commit them to the repository.</p>
<ul>
<li>Highlight all of the files that you have modified.</li>
<li>Right click and chose to <strong>SubWeaver &gt; Commit</strong></li>
<li>Dreamweaver will show you the SVN log in which it compares every file on your PC against the repositor and the action (add, modify, delete) it did to the version in the repository as well.</li>
<li>If you want to ensure you don&#8217;t miss anything, select the top-level folder for your plugin and then commit. Note that if you do this and you have added / deleted any files, you will have to specifically check their checkbox under the changes made window.</li>
</ul>
<p>The update process on the repository server will take a few minutes to show up in the <a title="Plugin Directory" href="http://wordpress.org/extend/plugins/about/">Plugin Directory</a>.</p>
<h3>Updates and Merges</h3>
<p>The work scenario I described above is written on the assumption that you are the only one editing files for your plugin. If you are collaborating on another plugin, before you start to work on changes you will want to execute an SVN update to ensure you have pulled the latest files from the server to your local PC.</p>
<p>It is possible (read: likely) that at some point in time you will encounter a scenario where someone else has updated the files which you are working on in between when you updated your files and when you went to commit. You now must merge your changes with theirs which is the bane of many developers. While Tortoise / SubWeaver do have tools built in to compare files, I have found that <a title="WinMerge" href="http://winmerge.org/">WinMerge</a> is a better tool built specifically for this task. You can install it and configure it with Tortoise under the Settings &gt; External Programs menu.</p>
]]></content:encoded>
			<wfw:commentRss>http://idealienstudios.com/blog/tutorials/share-your-plugin-on-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
