<?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/"
	
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>James Paul Muir &#187; nestedurls</title>
	<atom:link href="http://jamespaulmuir.com/tag/nestedurls/feed/" rel="self" type="application/rss+xml" />
	<link>http://jamespaulmuir.com</link>
	<description>Developer.Engineer.Musician.Geek</description>
	<lastBuildDate>Fri, 09 Oct 2009 15:40:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Nested URL Module updates</title>
		<link>http://jamespaulmuir.com/2009/10/nested-url-module-updates/</link>
		<comments>http://jamespaulmuir.com/2009/10/nested-url-module-updates/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 12:51:10 +0000</pubDate>
		<dc:creator>Jim Muir</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[nestedurls]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[SilverStripe]]></category>

		<guid isPermaLink="false">http://jamespaulmuir.com/?p=81</guid>
		<description><![CDATA[Hi All, Good news, I have moved the nested url module to github: http://github.com/jamespaulmuir/nestedurls I have been testing the nestedurl module (by writing unit/functional test) and hope to push those to github.  As I forgot to mention in my last post about this module, huge props to Andrew Short ( http://the-short.com/ ) for inspiring this module. [...]]]></description>
			<content:encoded><![CDATA[<p>Hi All,</p>
<p>Good news, I have moved the nested url module to github:<br />
<a href="http://github.com/jamespaulmuir/nestedurls"> http://github.com/jamespaulmuir/nestedurls</a></p>
<p>I have been testing the nestedurl module (by writing unit/functional test) and hope to push those to github.  As I forgot to mention in my last post about this module, huge props to Andrew Short ( http://the-short.com/ ) for inspiring this module.</p>
<p>Here&#8217;s the story:</p>
<p>OSU Libraries have been using code from Andrew&#8217;s nested URL branch by creating a diff of his changes, stripping out the non-nestedurl changes, and applying the diff to the stable releases of SilverStripe.  We&#8217;ve gone from 2.2.2 up to 2.3.3 using the special diff that was created.  The reason was because OSU Libraries cannot be running an unstable branch of code on our production site!  As of recently, we&#8217;ve been having a lot of problems with the nested URLs branch, so it was time to step back and re-evaluate.  So, one weekend I sat down with a fresh copy of SilverStripe 2.3.3 and started coding.   A few hours later, this module was born.  (Again, I can&#8217;t say this enough, THANKS Andrew Short for your inspiration for this!).</p>
<p>I wanted to see if this functionality could be put into SilverStripe while changing as little code in sapphire, cms, and jsparty as possible and being very simple so that SilverStripe can be easily updated.  I do believe that this module will be fully featured with a new cool feature (more on that in the next section).  The changes that I&#8217;ve made to the core are just adding some utility (added a setter for allParams to HTTPRequest, and an extend call in SiteTree-&gt;Link() &#8230; see previous post about nestedurls)</p>
<p>By simply extending SiteTree by adding a field called URLParent, nested URL functionality can be done and also another important feature: The ability to control the entire url structure of your SilverStripe site that is independent from the SiteTree/Menu structure.</p>
<p>For example:</p>
<p>At the Libraries, here is a portion of our Site Tree:</p>
<ul>
<li>About
<ul>
<li>Departments
<ul>
<li>Web Implementation Team (WIT)</li>
</ul>
</li>
<li>Committees
<ul>
<li>Web Visioning Committee (WVC)</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>So normally without Nested URLS, these pages would be:</p>
<ul>
<li><span style="background-color: #ffffff;">/about</span></li>
<li><span style="background-color: #ffffff;">/departments</span></li>
<li><span style="background-color: #ffffff;">/WIT</span></li>
<li><span style="background-color: #ffffff;">/committees</span></li>
<li><span style="background-color: #ffffff;">/WVC</span></li>
</ul>
<p>And with nestedurls (using my module, or Andrew Short&#8217;s nestedurl branch):</p>
<ul>
<li>/about</li>
<li>/about/departments</li>
<li>/about/departments/WIT</li>
<li>/about/committees</li>
<li>/about/committees/WVC</li>
</ul>
<p>Now, with the new feature of my nestedurl module, I can set the URLParent fields for the following:</p>
<ul>
<li>Departments: set URLParent = 0 (root of site)</li>
<li>Committees: set URLParent = 0 (root of site)</li>
</ul>
<p>And the result is the following:</p>
<ul>
<li>/about</li>
<li>/departments</li>
<li>/departments/WIT</li>
<li>/committees</li>
<li>/committees/WVC</li>
</ul>
<p>By default, if there is no URLParent field set for a given page, it will use the Parent field to determine the preceding URL segment.  <span style="background-color: #ffffff;">So as you can see, the URLs for WIT (department), and WVC (committee) are nested with departments and committees, respectively, because these page have a NULL value for URLParent so the normal Parent field is used.   The &#8220;parent url&#8221; for committees and departments have been overridden by the URLParent field that we set to 0 earlier  (so they jump to the root of the site).</span></p>
<p><span style="background-color: #ffffff;">In summary,  this module is still under development, and is currently being tested with other modules (googlesitemaps, userforms, dataobjectmanager, imagegallery).  I now have the module on Github to track changes and issues.  If anyone would like to contribute to this module, let me know!  Thanks so much for reading.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://jamespaulmuir.com/2009/10/nested-url-module-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>Nested URLS in a SilverStripe Module possible?</title>
		<link>http://jamespaulmuir.com/2009/08/nested-urls-in-a-silverstripe-module-possible/</link>
		<comments>http://jamespaulmuir.com/2009/08/nested-urls-in-a-silverstripe-module-possible/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 18:28:23 +0000</pubDate>
		<dc:creator>Jim Muir</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[nestedurls]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SilverStripe]]></category>

		<guid isPermaLink="false">http://jamespaulmuir.com/?p=28</guid>
		<description><![CDATA[I may be crazy, but I believe I have been able to get the basic functionality of Nested URLS in a module with only 2 modifications to the core of sapphire. Goals: As little change possible to the core of SilverStripe (cms, jsparty, sapphire) To separate navigation/Sitetree structure with URL structure Ability to toggle nested [...]]]></description>
			<content:encoded><![CDATA[<p>I may be crazy, but I believe I have been able to get the <em>basic</em> functionality of Nested URLS in a module with only 2 modifications to the core of sapphire.</p>
<p>Goals:
<ol style="margin-top: -5px;">
<li>As little change possible to the core of SilverStripe (cms, jsparty, sapphire)</li>
<li>To separate navigation/Sitetree structure with URL structure</li>
<li>Ability to toggle nested urls</li>
</ol>
<p><span id="more-28"></span></p>
<p>This requires SilverStripe 2.3+</p>
<p>To Install:<br />
1. Make the following changes to your SilverStripe installation:</p>
<pre class="brush: diff">Index: sapphire/core/control/HTTPRequest.php
===================================================================
--- sapphire/core/control/HTTPRequest.php
+++ sapphire/core/control/HTTPRequest.php
@@ -364,7 +364,10 @@
                if($arguments === array()) $arguments['_matched'] = true;
                return $arguments;
        }
-
+
+    function setParams($params){
+        $this-&gt;allParams = $params;
+    }
        function allParams() {
                return $this-&gt;allParams;
        }
Index: sapphire/core/model/SiteTree.php
===================================================================
--- sapphire/core/model/SiteTree.php
+++ sapphire/core/model/SiteTree.php
@@ -236,6 +236,10 @@
                        $action = "";
                }
                if($this-&gt;URLSegment == 'home' &amp;&amp; !$action) return Director::baseURL();
+        $result = $this-&gt;extend('Link',$action);
+        if($result){
+            return $result[0];
+        }
                else return Director::baseURL() . $this-&gt;URLSegment . "/$action";
        }
</pre>
<p>2.  Extract the module tar.gz into the base of you SilverStripe directory so that<br />
/nestedurls is parallel with /cms and /sapphire<br />
3.  Run /dev/build?flush=1<br />
4.  All done! You should know have nested urls!<br />
5.  Leave a comment or email me if you have any suggestions to change the code/make improvements/fix a bug/etc&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://jamespaulmuir.com/2009/08/nested-urls-in-a-silverstripe-module-possible/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
	</item>
	</channel>
</rss>
