<?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>Shawson&#039;s Code Blog &#187; Umbraco</title>
	<atom:link href="http://www.shawson.co.uk/codeblog/category/umbraco/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shawson.co.uk/codeblog</link>
	<description>development notes for my failing memory</description>
	<lastBuildDate>Mon, 26 Jul 2010 19:08:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Giving Umbraco custom tree&#8217;s children!</title>
		<link>http://www.shawson.co.uk/codeblog/giving-umbraco-trees-children/</link>
		<comments>http://www.shawson.co.uk/codeblog/giving-umbraco-trees-children/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 16:26:07 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[Umbraco]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=408</guid>
		<description><![CDATA[This was something i was looking for for a while- turns out it is buried deep in their forums;
As shown in their own example (I&#8217;ve reblogged here incase the page ever moves or dissapears!!)
Turns out it&#8217;s just a case of setting the &#8220;source&#8221; property of the XmlTreeNode.

public override void Render(ref XmlTree tree)
{

    [...]


Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/paged-list-of-child-nodes-un-umbraco/' rel='bookmark' title='Permanent Link: Paged List of Child Nodes in Umbraco'>Paged List of Child Nodes in Umbraco</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/umbraco-installation-folder-permissions-setup/' rel='bookmark' title='Permanent Link: Umbraco Installation &#8211; folder permissions setup'>Umbraco Installation &#8211; folder permissions setup</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>This was something i was looking for for a while- turns out it is buried <a href="http://our.umbraco.org/wiki/reference/backoffice-apis/tree-api---to-create-custom-treesapplications">deep in their forums</a>;</p>
<p>As shown in their own example (I&#8217;ve reblogged here incase the page ever moves or dissapears!!)</p>
<p>Turns out it&#8217;s just a case of setting the &#8220;source&#8221; property of the XmlTreeNode.</p>
<pre class="brush: csharp">
public override void Render(ref XmlTree tree)
{

            Dictionary.DictionaryItem[] tmp;
        //this.id is set when the tree.aspx creates this object.
        //It is the nodeID that is passed in via the tree service parameters (i.e. the query string)
        //this checks if the id is the StartNodeID (root node), if it’s not then this will
        //look up the child nodes for the current dictionary item.
            if (this.id == this.StartNodeID)
                tmp = Dictionary.getTopMostItems;
            else
                tmp = new Dictionary.DictionaryItem(this.id).Children;

            foreach (Dictionary.DictionaryItem di in tmp)
            {
             XmlTreeNode xNode = XmlTreeNode.Create(this);
             xNode.NodeID = di.id.ToString();
             xNode.Text = di.key;
             xNode.Action = string.Format(&quot;javascript:openDictionaryItem({0});&quot;, di.id);
             xNode.Icon = &quot;settingDataType.gif&quot;;
             xNode.OpenIcon = &quot;settingDataType.gif&quot;;
             //if there is no children, then set the source to an empty string
//this will ensure that there is no expand button for this node when it is
//rendered. Otherwise, set the source to the tree service url by using
//the BaseTree’s GetTreeServiceUrl method
             xNode.Source = di.hasChildren ? this.GetTreeServiceUrl(di.id) : &quot;&quot;;
             tree.Add(xNode);
            }
}
</pre>


<p>Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/paged-list-of-child-nodes-un-umbraco/' rel='bookmark' title='Permanent Link: Paged List of Child Nodes in Umbraco'>Paged List of Child Nodes in Umbraco</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/umbraco-installation-folder-permissions-setup/' rel='bookmark' title='Permanent Link: Umbraco Installation &#8211; folder permissions setup'>Umbraco Installation &#8211; folder permissions setup</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.shawson.co.uk/codeblog/giving-umbraco-trees-children/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Umbraco Installation &#8211; folder permissions setup</title>
		<link>http://www.shawson.co.uk/codeblog/umbraco-installation-folder-permissions-setup/</link>
		<comments>http://www.shawson.co.uk/codeblog/umbraco-installation-folder-permissions-setup/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 10:18:46 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Umbraco]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=399</guid>
		<description><![CDATA[Just a real quick batch script i knocked up which sets the appropriate permissions to the various folders in the root of a fresh umbraco install- just drop this into a batch file, and run it from the root of your umbraco install;

REM 2009.10.22 SY - Set permissions- user/ folders from "Install Umbraco 4 on [...]


Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/paged-list-of-child-nodes-un-umbraco/' rel='bookmark' title='Permanent Link: Paged List of Child Nodes in Umbraco'>Paged List of Child Nodes in Umbraco</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/command-line-batch-file-to-remove-direcories-using-a-wild-card/' rel='bookmark' title='Permanent Link: Command line Batch File to Remove Direcories, using a Wild Card!'>Command line Batch File to Remove Direcories, using a Wild Card!</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/giving-umbraco-trees-children/' rel='bookmark' title='Permanent Link: Giving Umbraco custom tree&#8217;s children!'>Giving Umbraco custom tree&#8217;s children!</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Just a real quick batch script i knocked up which sets the appropriate permissions to the various folders in the root of a fresh umbraco install- just drop this into a batch file, and run it from the root of your umbraco install;</p>
<pre>
REM 2009.10.22 SY - Set permissions- user/ folders from "Install Umbraco 4 on Windows Vista" guide
icacls app_code /grant "Network Service":(OI)(CI)(F)
icacls bin /grant "Network Service":(OI)(CI)(F)
icacls config /grant "Network Service":(OI)(CI)(F)
icacls css /grant "Network Service":(OI)(CI)(F)
icacls data /grant "Network Service":(OI)(CI)(F)
icacls masterpages /grant "Network Service":(OI)(CI)(F)
icacls media /grant "Network Service":(OI)(CI)(F)
icacls python /grant "Network Service":(OI)(CI)(F)
icacls scripts /grant "Network Service":(OI)(CI)(F)
icacls umbraco /grant "Network Service":(OI)(CI)(F)
icacls usercontrols /grant "Network Service":(OI)(CI)(F)
icacls xslt /grant "Network Service":(OI)(CI)(F)
pause
</pre>


<p>Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/paged-list-of-child-nodes-un-umbraco/' rel='bookmark' title='Permanent Link: Paged List of Child Nodes in Umbraco'>Paged List of Child Nodes in Umbraco</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/command-line-batch-file-to-remove-direcories-using-a-wild-card/' rel='bookmark' title='Permanent Link: Command line Batch File to Remove Direcories, using a Wild Card!'>Command line Batch File to Remove Direcories, using a Wild Card!</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/giving-umbraco-trees-children/' rel='bookmark' title='Permanent Link: Giving Umbraco custom tree&#8217;s children!'>Giving Umbraco custom tree&#8217;s children!</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.shawson.co.uk/codeblog/umbraco-installation-folder-permissions-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paged List of Child Nodes in Umbraco</title>
		<link>http://www.shawson.co.uk/codeblog/paged-list-of-child-nodes-un-umbraco/</link>
		<comments>http://www.shawson.co.uk/codeblog/paged-list-of-child-nodes-un-umbraco/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 16:13:06 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[Umbraco]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=388</guid>
		<description><![CDATA[We just started looking at Umbraco- and so I&#8217;m delving into Macro&#8217;s &#8211; these are the packaged up chunks of functionality which make your site actually do things and either take the form of XSLT files which process and spit out the contents of your database, or dot net controls.
I found an excellent example XSLT [...]


Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/giving-umbraco-trees-children/' rel='bookmark' title='Permanent Link: Giving Umbraco custom tree&#8217;s children!'>Giving Umbraco custom tree&#8217;s children!</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/umbraco-installation-folder-permissions-setup/' rel='bookmark' title='Permanent Link: Umbraco Installation &#8211; folder permissions setup'>Umbraco Installation &#8211; folder permissions setup</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>We just started looking at Umbraco- and so I&#8217;m delving into Macro&#8217;s &#8211; these are the packaged up chunks of functionality which make your site actually do things and either take the form of XSLT files which process and spit out the contents of your database, or dot net controls.</p>
<p>I found an excellent example XSLT that allows you to create a paginated list of child nodes over on <a href="http://www.nibble.be/?p=11">Tim Geyssens &#8220;nibble&#8221; blog</a>, and I&#8217;ve modified it ever so slightly to stop the numerical index rendering if the pagecount is less than 2- so thought I would re-post it!</p>
<pre class="brush: xslt">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE xsl:stylesheet [
  &lt;!ENTITY nbsp &quot;&amp;amp;amp;amp;#x00A0;&quot;&gt;
]&gt;
&lt;xsl:stylesheet
version=&quot;1.0&quot;
xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
xmlns:msxml=&quot;urn:schemas-microsoft-com:xslt&quot;
xmlns:umbraco.library=&quot;urn:umbraco.library&quot;
exclude-result-prefixes=&quot;msxml umbraco.library&quot;&gt;

  &lt;xsl:output method=&quot;xml&quot; omit-xml-declaration=&quot;yes&quot;/&gt;
  &lt;xsl:param name=&quot;currentPage&quot;/&gt;
  &lt;xsl:template match=&quot;/&quot;&gt;

    &lt;xsl:variable name=&quot;recordsPerPage&quot; select=&quot;/macro/recordsPerPage&quot;/&gt;
    &lt;xsl:variable name=&quot;pageNumber&quot; &gt;
      &lt;xsl:choose&gt;
        &lt;!-- first page --&gt;
        &lt;xsl:when test=&quot;umbraco.library:RequestQueryString(&#039;page&#039;) &lt;= 0 or string(umbraco.library:RequestQueryString(&#039;page&#039;)) = &#039;&#039; or string(umbraco.library:RequestQueryString(&#039;page&#039;)) = &#039;NaN&#039;&quot;&gt;0&lt;/xsl:when&gt;
        &lt;!-- what was passed in --&gt;
        &lt;xsl:otherwise&gt;
          &lt;xsl:value-of select=&quot;umbraco.library:RequestQueryString(&#039;page&#039;)&quot;/&gt;
        &lt;/xsl:otherwise&gt;
      &lt;/xsl:choose&gt;

    &lt;/xsl:variable&gt; &amp;amp;amp;amp;nbsp;

    &lt;xsl:variable name=&quot;numberOfRecords&quot; select=&quot;count($currentPage/node)&quot;/&gt;

    &lt;!-- The fun starts here --&gt;
    &lt;ul&gt;
      &lt;xsl:for-each select=&quot;$currentPage/node [string(data [@alias=&#039;umbracoNaviHide&#039;]) != &#039;1&#039;]&quot;&gt;
        &lt;xsl:if test=&quot;position() &gt; $recordsPerPage * number($pageNumber) and
position() &lt;= number($recordsPerPage * number($pageNumber) +
$recordsPerPage )&quot;&gt;
          &lt;li&gt;
            &lt;a href=&quot;{umbraco.library:NiceUrl(@id)}&quot;&gt;
              &lt;xsl:value-of select=&quot;@nodeName&quot;/&gt;

            &lt;/a&gt;
          &lt;/li&gt;
        &lt;/xsl:if&gt;
      &lt;/xsl:for-each&gt;
    &lt;/ul&gt;

    &lt;xsl:if test=&quot;$pageNumber &gt; 0&quot;&gt;
      &lt;a href=&quot;?page={$pageNumber -1}&quot;&gt;previous &lt;/a&gt;
    &lt;/xsl:if&gt;

&lt;xsl:if test=&quot;($numberOfRecords &gt; $recordsPerPage)&quot;&gt;
    &lt;xsl:call-template name=&quot;for.loop&quot;&gt;
      &lt;xsl:with-param name=&quot;i&quot;&gt;1&lt;/xsl:with-param&gt;
      &lt;xsl:with-param name=&quot;page&quot; select=&quot;$pageNumber +1&quot;&gt;&lt;/xsl:with-param&gt;
      &lt;xsl:with-param name=&quot;count&quot; select=&quot;ceiling(count($currentPage/node)div $recordsPerPage)&quot;&gt;&lt;/xsl:with-param&gt;
    &lt;/xsl:call-template&gt;
&lt;/xsl:if&gt;

    &lt;xsl:if test=&quot;(($pageNumber +1 ) * $recordsPerPage) &lt; ($numberOfRecords)&quot;&gt;
      &lt;a href=&quot;?page={$pageNumber +1}&quot;&gt;next&lt;/a&gt;
    &lt;/xsl:if&gt;
  &lt;/xsl:template&gt;

  &lt;xsl:template name=&quot;for.loop&quot;&gt;

    &lt;xsl:param name=&quot;i&quot;/&gt;
    &lt;xsl:param name=&quot;count&quot;/&gt;
    &lt;xsl:param name=&quot;page&quot;/&gt;
    &lt;xsl:if test=&quot;$i &lt;= $count - 1&quot;&gt;

      &lt;xsl:if test=&quot;$page != $i&quot;&gt;
        &lt;a href=&quot;{umbraco.library:NiceUrl($currentPage/@id)}?page={$i - 1}&quot; &gt;

          &lt;xsl:value-of select=&quot;$i&quot; /&gt;
        &lt;/a&gt;
      &lt;/xsl:if&gt;

      &lt;xsl:if test=&quot;$page = $i&quot;&gt;

        &lt;xsl:value-of select=&quot;$i&quot; /&gt;

      &lt;/xsl:if&gt;
    &lt;/xsl:if&gt;
    &lt;xsl:if test=&quot;$i &lt;= $count - 1&quot;&gt;
      &lt;xsl:call-template name=&quot;for.loop&quot;&gt;
        &lt;xsl:with-param name=&quot;i&quot;&gt;
          &lt;xsl:value-of select=&quot;$i + 1&quot;/&gt;
        &lt;/xsl:with-param&gt;
        &lt;xsl:with-param name=&quot;count&quot;&gt;
          &lt;xsl:value-of select=&quot;$count&quot;/&gt;
        &lt;/xsl:with-param&gt;
        &lt;xsl:with-param name=&quot;page&quot;&gt;
          &lt;xsl:value-of select=&quot;$page&quot;/&gt;
        &lt;/xsl:with-param&gt;
      &lt;/xsl:call-template&gt;
    &lt;/xsl:if&gt;
  &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
</pre>


<p>Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/giving-umbraco-trees-children/' rel='bookmark' title='Permanent Link: Giving Umbraco custom tree&#8217;s children!'>Giving Umbraco custom tree&#8217;s children!</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/umbraco-installation-folder-permissions-setup/' rel='bookmark' title='Permanent Link: Umbraco Installation &#8211; folder permissions setup'>Umbraco Installation &#8211; folder permissions setup</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.shawson.co.uk/codeblog/paged-list-of-child-nodes-un-umbraco/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
