<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title></title>
		<link>http://www.silverstripe.org/forums/rss</link>
		<atom:link href="http://www.silverstripe.org/forums/rss" rel="self" type="application/rss+xml" />
		<description></description>

		
		<item>
			<title>Re: SS 3.0.3 - Loop children not limited to children of current page - SOVLED</title>
			<link>http://www.silverstripe.org/template-questions/show/21792#post322054</link>
			<description>&lt;p&gt;And then a half year almost was gone... But thank you very much for the clearification.  &lt;img src='http://www.silverstripe.org/sapphire/images/smilies/smile.gif'&gt; &lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: SS 3.0.3 - Loop children not limited to children of current page - SOVLED | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/21792#post322054&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/21792&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Thu, 16 May 2013 07:43:47 +1200</pubDate>
			<dc:creator>Thomashv</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/21792#post322054</guid>
		</item>
		
		<item>
			<title>Re: Problems with links when using $Content.LimitWordCountXML(xx)</title>
			<link>http://www.silverstripe.org/template-questions/show/23745#post322050</link>
			<description>&lt;p&gt;That's fantastic it worked !  &lt;img src='http://www.silverstripe.org/sapphire/images/smilies/smile.gif'&gt; &lt;/p&gt;&lt;p&gt;You don't have to use a DataExtension class but it is highly recommended. The reason being, when a new blog module update comes out and you go to update your blog module, you'll have to account for that change in the code every time. You'll have to manually update the BlogEntry.php class with the getCustomSummary() function. Using a DataExtension, you won't have to do this!&lt;/p&gt;&lt;p&gt;You'll want to make a new php file in your mysite/code folder called BlogEntryExtension.php and use the code i provided in my previous post. After you make the new BlogEntryExtension.php class and add the extra line to your _config.php do a ?flush=all on your site. it won't take long and will save you a ton of time in the future.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Problems with links when using $Content.LimitWordCountXML(xx) | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23745#post322050&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23745&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Thu, 16 May 2013 04:48:46 +1200</pubDate>
			<dc:creator>IOTI</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23745#post322050</guid>
		</item>
		
		<item>
			<title>Re: Problems with links when using $Content.LimitWordCountXML(xx)</title>
			<link>http://www.silverstripe.org/template-questions/show/23745#post322049</link>
			<description>&lt;p&gt;Thank you very much IOTI! &lt;/p&gt;&lt;p&gt;I've included your &quot;getCustomSummary&quot; function to my BlogEntry class just to see if it works for me (and $getCustomSummary in BlogSummary.ss). Everything works great now!  &lt;img src='http://www.silverstripe.org/sapphire/images/smilies/smile.gif'&gt; &lt;/p&gt;&lt;p&gt;Do I still need to do it with a BlogEntryExtension? Is there any difference between both solutions?&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Problems with links when using $Content.LimitWordCountXML(xx) | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23745#post322049&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23745&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Thu, 16 May 2013 04:19:34 +1200</pubDate>
			<dc:creator>iraira88</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23745#post322049</guid>
		</item>
		
		<item>
			<title>Re: Problems with links when using $Content.LimitWordCountXML(xx)</title>
			<link>http://www.silverstripe.org/template-questions/show/23745#post322045</link>
			<description>&lt;p&gt;Hi iraira88&lt;/p&gt;&lt;p&gt;You'll have to create a custom function for your BlogEntry class to get the functionality you want. Start by creating a DataExtension of the BlogEntry class.&lt;/p&gt;&lt;p&gt;I've included some code I used in an old 2.4 project. it is untested in 3.0 so may require some modification.&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;class BlogEntryExtension extends DataExtension {&lt;/p&gt;&lt;p&gt;      /**&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Returns a Summary of the content but retains links (including the pesky site_tree_id links)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * also removes images.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @return (string)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; **/&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public function getCustomSummary($maxWords = 35){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$content = $this-&amp;gt;obj('Content');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$data = (string)$content-&amp;gt;forTemplate();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$data = strip_tags($data, '&amp;lt;a&amp;gt;');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// grab the first paragraph, or, failing that, the whole content&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if( strpos( $data, &quot;\n\n&quot; ) )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$data = substr( $data, 0, strpos( $data, &quot;\n\n&quot; ) );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$sentences = explode( '.', $data );&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$count = count( explode( ' ', $sentences[0] ) );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// if the first sentence is too long, show only the first $maxWords words&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if( $count &amp;gt; $maxWords ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return implode( ' ', array_slice( explode( ' ', $sentences[0] ), 0, $maxWords ) ).'...';&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// add each sentence while there are enough words to do so&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$result = '';&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;do {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$result .= trim(array_shift( $sentences )).'.';&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(count($sentences) &amp;gt; 0) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$count += count( explode( ' ', $sentences[0] ) );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Ensure that we don't trim half way through a tag or a link&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$brokenLink = (substr_count($result,'&amp;lt;') != substr_count($result,'&amp;gt;')) ||&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(substr_count($result,'&amp;lt;a') != substr_count($result,'&amp;lt;/a'));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} while( ($count &amp;lt; $maxWords || $brokenLink) &amp;amp;&amp;amp; $sentences &amp;amp;&amp;amp; trim( $sentences[0] ) );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if( preg_match( '/&amp;lt;a[^&amp;gt;]*&amp;gt;/', $result ) &amp;amp;&amp;amp; !preg_match( '/&amp;lt;\/a&amp;gt;/', $result ) )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$result .= '&amp;lt;/a&amp;gt;';&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return $result;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;and then in your _config.php add&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;Object::add_extension('BlogEntry','BlogEntryExtension');&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;and in BlogSummary.ss use $CustomSummary instead of $Content.LimitWordCountXML. Hope that helps.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Problems with links when using $Content.LimitWordCountXML(xx) | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23745#post322045&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23745&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Thu, 16 May 2013 00:28:57 +1200</pubDate>
			<dc:creator>IOTI</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23745#post322045</guid>
		</item>
		
		<item>
			<title>Problems with links when using $Content.LimitWordCountXML(xx)</title>
			<link>http://www.silverstripe.org/template-questions/show/23745</link>
			<description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;is there a possibility to parse out links when using &quot;$Content.LimitWordCountXML(xx)&quot; in my template? I use the blog module ( Silverstripe 3 ) on my website and &quot;$Content.LimitWordCountXML(18)&quot; in BlogSummary.ss to show some short teasers on the BlogHolder page. The problem is: when I have a link in my BlogEntry content like&lt;/p&gt;&lt;p&gt;&quot; &amp;lt;a href=&quot;http://www.screenplane.com/products/steadyflex/&quot;&amp;gt;Screenplane&amp;lt;/a&amp;gt; &quot;&lt;/p&gt;&lt;p&gt;it will be displayed like this on my website: &lt;/p&gt;&lt;p&gt;&quot; Screenplane[&lt;a href=&quot;http://www.screenplane.com/products/steadyflex/&quot; rel=&quot;nofollow&quot;&gt;http://www.screenplane.com/products/steadyflex/&lt;/a&gt;] &quot;&lt;/p&gt;&lt;p&gt;Can somebody help me with this issue?&lt;/p&gt;&lt;p&gt;Many thanks,&lt;br /&gt;Irina&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Problems with links when using $Content.LimitWordCountXML(xx) | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23745&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23745&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Thu, 16 May 2013 00:13:25 +1200</pubDate>
			<dc:creator>iraira88</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23745</guid>
		</item>
		
		<item>
			<title>Re: Extending StringField Class - &quot;Trying to get property of non-object&quot; Error Message</title>
			<link>http://www.silverstripe.org/template-questions/show/23696#post321977</link>
			<description>&lt;p&gt;I worked out that the reason for the error was because the first result being returned was 'null'. Not sure why though?&lt;/p&gt;&lt;p&gt;Anyway, I added an additional check to filter out this error:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;public function StringToKey()&lt;br /&gt;{&lt;br /&gt;    if (!$this-&amp;gt;owner instanceof Varchar) {&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;/p&gt;&lt;p&gt;    $title = $this-&amp;gt;owner-&amp;gt;value;&lt;br /&gt;    if ($title != null) {&lt;br /&gt;        return $this-&amp;gt;convertString($title);&lt;br /&gt;        // var_dump($this-&amp;gt;convertString($title));&lt;br /&gt;    } else {&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;}&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;Not sure if this is the best way to do things, but it's the only thing I could think of.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Extending StringField Class - &amp;quot;Trying to get property of non-object&amp;quot; Error Message | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23696#post321977&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23696&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Sun, 12 May 2013 01:23:27 +1200</pubDate>
			<dc:creator>_Matt</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23696#post321977</guid>
		</item>
		
		<item>
			<title>Re: Dividing menu items into groups</title>
			<link>http://www.silverstripe.org/template-questions/show/7960?start=8#post321966</link>
			<description>&lt;p&gt;The modulus function will help solve your issue&lt;br /&gt;&lt;a href=&quot;http://doc.silverstripe.org/framework/en/2.4/reference/advanced-templates#modulus-and-multipleof&quot; rel=&quot;nofollow&quot;&gt;http://doc.silverstripe.org/framework/en/2.4/reference/advanced-templates#modulus-and-multipleof&lt;/a&gt;&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Dividing menu items into groups | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/7960?start=8#post321966&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/7960&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Sat, 11 May 2013 06:25:21 +1200</pubDate>
			<dc:creator>zlincoln</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/7960?start=8#post321966</guid>
		</item>
		
		<item>
			<title>Extending StringField Class - &quot;Trying to get property of non-object&quot; Error Message</title>
			<link>http://www.silverstripe.org/template-questions/show/23696</link>
			<description>&lt;p&gt;I've written an extension called 'StringToKey' that converts a template value, such as $Title, into lowercase with the spaces changed into hyphens - a bit like when you do $Title.LowerCase, or $Title.UpperCase.&lt;/p&gt;&lt;p&gt;In my case I'm converting menu titles in my template, like this (in a Menu loop):&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;ul class=&quot;submenu $Title.StringToKey&quot;&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;It is working (the values are correctly output in the template), but I'm also getting a big error message at the top of the page:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&quot;[Notice] Trying to get property of non-object&quot;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;It then highlights this line in my code:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;$title = $this-&amp;gt;owner-&amp;gt;value;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;Can anyone suggest why this might be happening, I'm a bit stuck? Here's my full code:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;?php&lt;br /&gt;class StringToKey extends Extension&lt;br /&gt;{&lt;br /&gt;    /**&lt;br /&gt;     * Return StringToKey&lt;br /&gt;     *&lt;br /&gt;     * @return string&lt;br /&gt;     */&lt;br /&gt;    public function StringToKey()&lt;br /&gt;    {&lt;br /&gt;        $title = $this-&amp;gt;owner-&amp;gt;value;&lt;/p&gt;&lt;p&gt;        if ($title != null)&lt;br /&gt;        {&lt;br /&gt;            return $this-&amp;gt;convertString($title);&lt;br /&gt;            // var_dump($this-&amp;gt;convertString($title));&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            return false;&lt;br /&gt;        }&lt;br /&gt;    }&lt;/p&gt;&lt;p&gt;    /**&lt;br /&gt;     * Convert string to lowercase and replace spaces with hyphens&lt;br /&gt;     *&lt;br /&gt;     * @return string&lt;br /&gt;     */&lt;br /&gt;    protected function convertString($string)&lt;br /&gt;    {&lt;br /&gt;        // Lower case everything&lt;br /&gt;        $string = strtolower($string);&lt;br /&gt;        // Make alphaunermic&lt;br /&gt;        $string = preg_replace(&quot;/[^a-z0-9_\s-]/&quot;, &quot;&quot;, $string);&lt;br /&gt;        // Clean multiple dashes or whitespace&lt;br /&gt;        $string = preg_replace(&quot;/[\s-]+/&quot;, &quot; &quot;, $string);&lt;br /&gt;        // Convert whitespace and underscores to hyphens&lt;br /&gt;        $string = preg_replace(&quot;/[\s_]/&quot;, &quot;-&quot;, $string);&lt;br /&gt;        return $string;&lt;br /&gt;    }&lt;br /&gt;}&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Extending StringField Class - &amp;quot;Trying to get property of non-object&amp;quot; Error Message | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23696&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23696&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Fri, 10 May 2013 10:50:35 +1200</pubDate>
			<dc:creator>_Matt</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23696</guid>
		</item>
		
		<item>
			<title>Re: one.com and i18n</title>
			<link>http://www.silverstripe.org/template-questions/show/23536#post321543</link>
			<description>&lt;p&gt;SOLVED!!!&lt;/p&gt;&lt;p&gt;Sorry for spamming you. I haven' read the docs carefully. on &lt;a href=&quot;http://doc.silverstripe.org/framework/en/topics/i18n&quot; rel=&quot;nofollow&quot;&gt;http://doc.silverstripe.org/framework/en/topics/i18n&lt;/a&gt; it says: &lt;br /&gt;&lt;strong&gt;$entity: Unique identifier, composed by a namespace and an entity name, with a dot separating them. Both are arbitrary names, although by convention we use the name of the containing class or template. Use this identifier to reference the same translation elsewhere in your code. &lt;/strong&gt;&lt;/p&gt;&lt;p&gt;It has to be: &amp;lt;% _t('&lt;strong&gt;Page.&lt;/strong&gt;HOME','Home') %&amp;gt;&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: one.com and i18n | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23536#post321543&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23536&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Wed, 24 Apr 2013 18:46:04 +1200</pubDate>
			<dc:creator>dacar</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23536#post321543</guid>
		</item>
		
		<item>
			<title>Re: one.com and i18n</title>
			<link>http://www.silverstripe.org/template-questions/show/23536#post321542</link>
			<description>&lt;p&gt;de.yml doesn't work, too:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;de:&lt;br /&gt;  Page:&lt;br /&gt;    HOME: 'Start'&lt;br /&gt;    ABOUT: '&amp;amp;Uuml;ber uns'&lt;br /&gt;    SERVICES: 'Service'&lt;br /&gt;    WORKS: 'Unsere Arbeit'&lt;br /&gt;    CONTACT: 'Kontakt'&lt;br /&gt;    MORE: 'mehr'&lt;br /&gt;    PREV: 'zurück'&lt;br /&gt;    NEXT: 'weiter'&lt;br /&gt;    EXPERTISE: 'Unsere Expertise'&lt;br /&gt;    ALL: 'Alle Kategorien'&lt;br /&gt;    CONTACTFORM: 'Kontakt'&lt;br /&gt;    NAME: 'Name'&lt;br /&gt;    EMAIL: 'Email'&lt;br /&gt;    MESSAGE: 'Nachricht'&lt;br /&gt;    SENDAMESSAGE: 'Absenden'&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: one.com and i18n | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23536#post321542&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23536&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Wed, 24 Apr 2013 18:36:15 +1200</pubDate>
			<dc:creator>dacar</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23536#post321542</guid>
		</item>
		
		<item>
			<title>Re: one.com and i18n</title>
			<link>http://www.silverstripe.org/template-questions/show/23536#post321541</link>
			<description>&lt;p&gt;i have just put an echo to the init function to show the current locale:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if($this-&amp;gt;dataRecord-&amp;gt;hasExtension('Translatable')) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;i18n::set_locale($this-&amp;gt;dataRecord-&amp;gt;Locale);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//i18n::set_locale(Translatable::get_current_locale()); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//i18n::set_locale('de_DE'); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo i18n::get_locale();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/p&gt;&lt;p&gt;At this point everything works fine. Why does Silverstripe not find my translation files?&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: one.com and i18n | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23536#post321541&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23536&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Wed, 24 Apr 2013 18:27:59 +1200</pubDate>
			<dc:creator>dacar</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23536#post321541</guid>
		</item>
		
		<item>
			<title>one.com and i18n</title>
			<link>http://www.silverstripe.org/template-questions/show/23536</link>
			<description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;has anybody had trouble with SS3.05, one.com and i18n? I can not get it working.&lt;/p&gt;&lt;p&gt;mysite/_config.php:&lt;br /&gt;i18n::set_locale('da_DK');&lt;br /&gt;global $allowed_i18n;&lt;br /&gt;$allowed_i18n = array( &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;'dk' =&amp;gt; &quot;da_DK&quot;, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;'en' =&amp;gt; &quot;en_US&quot;, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;'de' =&amp;gt; &quot;de_DE&quot;&lt;br /&gt;);&lt;/p&gt;&lt;p&gt;i18n::$common_locales = array(&lt;br /&gt;    'da_DK' =&amp;gt; array('Danish', 'Danish'),&lt;br /&gt;    'en_US' =&amp;gt; array('English (US)', 'English (US)'),&lt;br /&gt;    'de_DE' =&amp;gt; array('German', 'Deutsch')&lt;br /&gt;);&lt;br /&gt;Translatable::set_default_locale('da_DK');&lt;br /&gt;Translatable::set_allowed_locales(array('de_DE', 'da_DK', 'en_US')); &lt;br /&gt;Object::add_extension('SiteTree', 'Translatable');&lt;br /&gt;Object::add_extension('SiteConfig', 'Translatable');&lt;/p&gt;&lt;p&gt;mysite/code/page.php&lt;/p&gt;&lt;p&gt;...&lt;br /&gt;public function init() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parent::init();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if($this-&amp;gt;dataRecord-&amp;gt;hasExtension('Translatable')) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;i18n::set_locale($this-&amp;gt;dataRecord-&amp;gt;Locale);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//i18n::set_locale(Translatable::get_current_locale()); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//i18n::set_locale('de_DE'); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//i18n::set_locale($this-&amp;gt;dataRecord-&amp;gt;Locale);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//i18n::set_locale(Translatable::get_current_locale()); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//i18n::set_locale('de_DE'); &lt;br /&gt;...&lt;/p&gt;&lt;p&gt;mysite/lang/de_DE.php&lt;/p&gt;&lt;p&gt;&amp;lt;?php&lt;br /&gt;global $lang;&lt;br /&gt;//Page.ss translated fields&lt;br /&gt;$lang['de_DE']['Page.ss']['HOME'] = 'Start';&lt;br /&gt;$lang['de_DE']['Page.ss']['ABOUT'] = '&amp;amp;Uuml;ber uns';&lt;br /&gt;$lang['de_DE']['Page.ss']['SERVICES'] = 'Service';&lt;br /&gt;$lang['de_DE']['Page.ss']['WORKS'] = 'Unsere Arbeit';&lt;br /&gt;$lang['de_DE']['Page.ss']['CONTACT'] = 'Kontakt';&lt;br /&gt;$lang['de_DE']['Otherthemefilename.ss']['TRANSLATABLEFIELD'] = 'Translatable field translation';&lt;/p&gt;&lt;p&gt;$lang['de_DE']['Page.ss']['MORE'] = 'mehr';&lt;br /&gt;$lang['de_DE']['Page.ss']['PREV'] = 'zurück';&lt;br /&gt;$lang['de_DE']['Page.ss']['NEXT'] = 'weiter';&lt;br /&gt;$lang['de_DE']['Page.ss']['EXPERTISE'] = 'Unsere Expertise';&lt;br /&gt;$lang['de_DE']['Page.ss']['ALL'] = 'Alle Kategorien';&lt;br /&gt;$lang['de_DE']['Page.ss']['CONTACTFORM'] = 'Kontakt';&lt;br /&gt;$lang['de_DE']['Page.ss']['NAME'] = 'Name';&lt;br /&gt;$lang['de_DE']['Page.ss']['EMAIL'] = 'Email';&lt;br /&gt;$lang['de_DE']['Page.ss']['MESSAGE'] = 'Nachricht';&lt;br /&gt;$lang['de_DE']['Page.ss']['SENDAMESSAGE'] = 'Absenden';&lt;/p&gt;&lt;p&gt;$lang['de_DE']['Page.ss']['SHOWINPAGE'] = 'Zeige Seiten auf deutsch.';&lt;br /&gt;$lang['de_DE']['Page']['SHOWINPAGE'] = 'Zeige Seiten auf deutsch.';&lt;br /&gt;$lang['de_DE']['SHOWINPAGE'] = 'Zeige Seiten auf deutsch.';&lt;/p&gt;&lt;p&gt;$lang['de_DE']['Page']['SERVICES'] = 'Service';&lt;br /&gt;$lang['de_DE']['Top']['SERVICES'] = 'Service';&lt;br /&gt;?&amp;gt;&lt;/p&gt;&lt;p&gt;themes/project/templates/page.ss:&lt;/p&gt;&lt;p&gt;&amp;lt;% _t('Page.ss.SERVICES','Services') %&amp;gt; OR&lt;br /&gt;&amp;lt;% _t('Page.SERVICES','Services') %&amp;gt; OR&lt;br /&gt;&amp;lt;% _t('SERVICES','Services') %&amp;gt;&lt;/p&gt;&lt;p&gt;The t-function will not be translated???&lt;/p&gt;&lt;p&gt;But &amp;lt;% sprintf(_t('SHOWINPAGE','Show page in %s'),$Locale.Nice) %&amp;gt; Is translated to &quot;Show page in german&quot;.&lt;/p&gt;&lt;p&gt;Can anybody help?&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: one.com and i18n | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23536&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23536&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Wed, 24 Apr 2013 06:45:48 +1200</pubDate>
			<dc:creator>dacar</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23536</guid>
		</item>
		
		<item>
			<title>Silverstripe 3 templates not preserving white space: breaking inline block elements</title>
			<link>http://www.silverstripe.org/template-questions/show/23534</link>
			<description>&lt;p&gt;I'm trying to iterate over a list in a template using &amp;lt;% loop %&amp;gt; to produce a few boxes to display inline-block. The sum of the boxes needs to occupy the full width of the parent container. White space between elements in the HTML causes a gap (&lt;a href=&quot;http://css-tricks.com/fighting-the-space-between-inline-block-elements/&quot; rel=&quot;nofollow&quot;&gt;http://css-tricks.com/fighting-the-space-between-inline-block-elements/&lt;/a&gt;) which in turn causes the last element in the list to wrap to the next line.&lt;/p&gt;&lt;p&gt;Floats won't do because the boxes need to be vertical-align: middle as it's a fluid width template and the box heights change depending on window width.&lt;/p&gt;&lt;p&gt;The solution I've been using in 2.4 is to place HTML comments between the start and end of each element to remove the white space. Example template:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;div class=&quot;breadcrumbs&quot;&amp;gt;&amp;lt;!--&lt;br /&gt;    &amp;lt;% loop $Steps %&amp;gt;&lt;br /&gt;        --&amp;gt;&amp;lt;div class=&quot;step&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;        &amp;lt;/div&amp;gt;&amp;lt;!--&lt;br /&gt;    &amp;lt;% end_loop %&amp;gt;&lt;br /&gt;--&amp;gt;&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;However in the rendered HTML the start comments are pushed down to the next line which introduces a space and gives the following HTML:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;div class=&quot;breadcrumbs&quot;&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;/p&gt;&lt;p&gt;        --&amp;gt;&amp;lt;div class=&quot;step&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;        &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;/p&gt;&lt;p&gt;        --&amp;gt;&amp;lt;div class=&quot;step&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;        &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;/p&gt;&lt;p&gt;        --&amp;gt;&amp;lt;div class=&quot;step&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;        &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;/p&gt;&lt;p&gt;--&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;Another solution that worked in 2.4 was to remove the line breaks between the elements:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;div class=&quot;breadcrumbs&quot;&amp;gt;&lt;br /&gt;    &amp;lt;% loop $Steps %&amp;gt;&amp;lt;div class=&quot;step&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;    &amp;lt;/div&amp;gt;&amp;lt;% end_loop %&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;Or even:&lt;br /&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;div class=&quot;breadcrumbs&quot;&amp;gt;&lt;br /&gt;    &amp;lt;% loop $Steps %&amp;gt;&amp;lt;div class=&quot;step&quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;% end_loop %&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;But again the template parser in SS3 is pushing the next block onto the next line:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;div class=&quot;breadcrumbs&quot;&amp;gt;&lt;br /&gt;    &amp;lt;div class=&quot;step&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;div class=&quot;step&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;div class=&quot;step&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;Can anyone think of a workaround to get a row of &amp;lt;% loop %&amp;gt;ed boxes to display inline-block and occupy the full width of the parent container? Also should I report this as a bug?&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Silverstripe 3 templates not preserving white space: breaking inline block elements | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23534&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23534&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Wed, 24 Apr 2013 01:08:28 +1200</pubDate>
			<dc:creator>AlexMalet</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23534</guid>
		</item>
		
		<item>
			<title>Re: 2.4x - Dynamic Include for Sidebars</title>
			<link>http://www.silverstripe.org/template-questions/show/23523#post321521</link>
			<description>&lt;p&gt;In your TemplateInclude function on your SidebarBoxes DataObjects you're calling:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;$this-&amp;gt;renderWith($this-&amp;gt;Template)&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;That's rendering the template with the DataObject as the main scope. The getMenu() function is part of ContentController. That's why it works when you include the template directly from your main page template: because the Page's Controller, and therefore getMenu(), is accessible in the template scope. Try:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;public function TemplateInclude() {&lt;br /&gt;    $controller = Controller::curr();&lt;br /&gt;    return $controller-&amp;gt;renderWith($this-&amp;gt;Template);&lt;br /&gt;}&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: 2.4x - Dynamic Include for Sidebars | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23523#post321521&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23523&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Tue, 23 Apr 2013 22:08:28 +1200</pubDate>
			<dc:creator>amalet</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23523#post321521</guid>
		</item>
		
		<item>
			<title>2.4x - Dynamic Include for Sidebars</title>
			<link>http://www.silverstripe.org/template-questions/show/23523</link>
			<description>&lt;p&gt;I've searched and searched, but I haven't found much help. I think it may be more of about how I'm approaching this whole template structure:&lt;/p&gt;&lt;p&gt;Page.php - has a Page.ss template, and a Layouts/Page.ss template&lt;br /&gt;--&amp;gt;MarketingPage.php - Extends page. Only has a Layouts/MarketingPage.ss template&lt;/p&gt;&lt;p&gt;I am using Twitter Bootstrap for the theme structure, so the common structure is found in the root Page.ss file. Simplified version here:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;body&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;!-- Page Container --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;div class=&quot;container&quot; id=&quot;main-content-container-trans&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &amp;lt;div class=&quot;row-fluid&quot;&amp;gt;      &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;!-- Main Content Container --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;div class=&quot;span9&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;h1&amp;gt;$Title.XML&amp;lt;/h1&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;div class=&quot;row-fluid main-text-container&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$Layout&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;!-- Sidebar --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;div class=&quot;span3&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &amp;lt;/div&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;The challenge is the contents of the Sidebar div. While the heirachy of this structure works just fine for $Layout should I make a new page type, the sidebar content will be different depending on the page type. So what I need is dynamic include mechanism that is fed from the page type class (in this instance, MarketingPage.php). &lt;/p&gt;&lt;p&gt;I have found several ways to store and get the names of the include files to the template, using a DataObject that allows you to select a template file from the CMS (the dataobject reads the Includes directory) using ComplexTableField. Then, in this DataObject I have the following method:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;public function TemplateInclude() { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return $this-&amp;gt;renderWith($this-&amp;gt;Template); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;And in the Page.ss template above, I do this:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;!-- Sidebar --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;div class=&quot;span3&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% if SideBarBoxes %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% control SidebarBoxes %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$TemplateInclude&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% end_control %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% end_if %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;Now, this works. It includes any templates selected in the CMS. However the problem is that include template has no knowledge of the page that is including it, and won't display relevant data such as Children for navigation (as an example).&lt;/p&gt;&lt;p&gt;To make it clear, imagine the selected include was just a basic nav called Navigation.ss:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;% control Menu(2) %&amp;gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% if Children %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;li class=&quot;$LinkingMode&quot;&amp;gt;&amp;lt;a href=&quot;$Link&quot; title=&quot;Go to the $Title.XML page&quot; class=&quot;$LinkingMode levela&quot;&amp;gt;&amp;lt;span&amp;gt;&amp;lt;em&amp;gt;$MenuTitle&amp;lt;/em&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% else %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;li&amp;gt;&amp;lt;a href=&quot;$Link&quot; title=&quot;Go to the $Title.XML page&quot; class=&quot;$LinkingMode levela&quot;&amp;gt;&amp;lt;span&amp;gt;&amp;lt;em&amp;gt;$MenuTitle&amp;lt;/em&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% end_if %&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;This will appear blank using my dynamic method above. But if I had code it onto the template using &amp;lt;% include Navigation %&amp;gt;, it works just as expected, displaying links to the current page's children.&lt;/p&gt;&lt;p&gt;Any ideas?&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: 2.4x - Dynamic Include for Sidebars | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23523&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23523&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Mon, 22 Apr 2013 20:16:45 +1200</pubDate>
			<dc:creator>Double-A-Ron</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23523</guid>
		</item>
		
		<item>
			<title>Re: Menu font size</title>
			<link>http://www.silverstripe.org/template-questions/show/23291#post321352</link>
			<description>&lt;p&gt;If you don't see it in the layout.css file - look in the typography.css file (if there is one).&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Menu font size | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23291#post321352&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23291&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Sat, 13 Apr 2013 08:24:44 +1200</pubDate>
			<dc:creator>goodness</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23291#post321352</guid>
		</item>
		
		<item>
			<title>Re: Menu font size</title>
			<link>http://www.silverstripe.org/template-questions/show/23291#post321238</link>
			<description>&lt;p&gt;Changes to font sizes should take place in your css files. I am not familiar with the wine theme, but most designers have a css file called layout.css ( i know Black Candy uses that). &lt;/p&gt;&lt;p&gt;Also a handy tool when developing is to use Firebug (works with Chrome and Firefox) it allows you to click on a element and see exactly which css file and what line of code is supplying its attributes.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Menu font size | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23291#post321238&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23291&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Sun, 07 Apr 2013 09:55:43 +1200</pubDate>
			<dc:creator>Optic Blaze</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23291#post321238</guid>
		</item>
		
		<item>
			<title>Re: JavaScript in the Template</title>
			<link>http://www.silverstripe.org/template-questions/show/23365#post321237</link>
			<description>&lt;p&gt;Hello &lt;/p&gt;&lt;p&gt;1) If you want to require jquery.javascript files You could try ....&lt;br /&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;{$ThemeDir}/tcc/js/jquery-1.9.1.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/p&gt;&lt;p&gt;$ThemeDir can be set i your config.php file or in the CMS -&amp;gt; Settings section&lt;/p&gt;&lt;p&gt;2) If you need to include specific scripts eg &amp;lt;script&amp;gt; alert('Hello') &amp;lt;/script&amp;gt; you could put it in a seperate .ss file and then just load it with the &amp;lt;% include MyScript.ss %&amp;gt; command&lt;/p&gt;&lt;p&gt;3) Just remember that if you use require to load in javascript it tends to load it at the bottom of the page. That is because it is more efficient to load jquery and javascript files at the end of the page.&lt;/p&gt;&lt;p&gt;Hope it help&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: JavaScript in the Template | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23365#post321237&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23365&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Sun, 07 Apr 2013 09:51:47 +1200</pubDate>
			<dc:creator>Optic Blaze</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23365#post321237</guid>
		</item>
		
		<item>
			<title>Re: A page head for each section</title>
			<link>http://www.silverstripe.org/template-questions/show/5316?start=16#post321228</link>
			<description>&lt;p&gt;Hi everyone. I'm also new to php code as well and I wondered how alter it to accept not only images but also swf files? Is there a simple solution to this?&lt;br /&gt;Thanks&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: A page head for each section | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/5316?start=16#post321228&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/5316&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Sat, 06 Apr 2013 14:33:01 +1300</pubDate>
			<dc:creator>Rachel</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/5316?start=16#post321228</guid>
		</item>
		
		<item>
			<title>Re: Why does &lt;% with Content %&gt;$LimitWordCountXML(10)&lt;% end_with %&gt; but $Content.LimitWordCountXML(10) doesn&#39;t</title>
			<link>http://www.silverstripe.org/template-questions/show/23378#post321199</link>
			<description>&lt;p&gt;You're right!  Great suggestion!  Surrounding the statement in curly braces got it working.&lt;/p&gt;&lt;p&gt;Thanks Kinglozzer.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Why does &amp;lt;% with Content %&amp;gt;$LimitWordCountXML(10)&amp;lt;% end_with %&amp;gt; but $Content.LimitWordCountXML(10) doesn&amp;#39;t | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23378#post321199&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23378&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Thu, 04 Apr 2013 11:51:19 +1300</pubDate>
			<dc:creator>vwd</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23378#post321199</guid>
		</item>
		
		<item>
			<title>Re: Displaying grandchildren pages in alphabetical order</title>
			<link>http://www.silverstripe.org/template-questions/show/23296#post321182</link>
			<description>&lt;p&gt;Thanks! That worked nicely. I think this is beginning to make sense to me now!&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Displaying grandchildren pages in alphabetical order | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23296#post321182&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23296&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Wed, 03 Apr 2013 23:02:30 +1300</pubDate>
			<dc:creator>Strandoo</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23296#post321182</guid>
		</item>
		
		<item>
			<title>Re: Why does &lt;% with Content %&gt;$LimitWordCountXML(10)&lt;% end_with %&gt; but $Content.LimitWordCountXML(10) doesn&#39;t</title>
			<link>http://www.silverstripe.org/template-questions/show/23378#post321181</link>
			<description>&lt;p&gt;In your template, try:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;p&amp;gt;{$Content.LimitWordCountXML(10)}...&amp;lt;/p&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;I wonder if it's picking up those extra dots after and that's what's throwing it.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Why does &amp;lt;% with Content %&amp;gt;$LimitWordCountXML(10)&amp;lt;% end_with %&amp;gt; but $Content.LimitWordCountXML(10) doesn&amp;#39;t | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23378#post321181&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23378&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Wed, 03 Apr 2013 21:58:48 +1300</pubDate>
			<dc:creator>kinglozzer</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23378#post321181</guid>
		</item>
		
		<item>
			<title>Re: Displaying grandchildren pages in alphabetical order</title>
			<link>http://www.silverstripe.org/template-questions/show/23296#post321176</link>
			<description>&lt;p&gt;Then don't use nested controls, create a new function to return your sorted list&lt;/p&gt;&lt;p&gt;function getCities() {&lt;br /&gt;return DataObject::get(&quot;City&quot;, &quot;&quot;, &quot;Title ASC&quot;);&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;Assuming you have a pagetype for 'City', if not, then you can use the 2nd parameter for doing a SQL 'where' query.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Displaying grandchildren pages in alphabetical order | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23296#post321176&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23296&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Wed, 03 Apr 2013 18:34:01 +1300</pubDate>
			<dc:creator>Willr</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23296#post321176</guid>
		</item>
		
		<item>
			<title>Why does &lt;% with Content %&gt;$LimitWordCountXML(10)&lt;% end_with %&gt; but $Content.LimitWordCountXML(10) doesn&#39;t</title>
			<link>http://www.silverstripe.org/template-questions/show/23378</link>
			<description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I'm trying to create a number limited list of 'latest blog posts' in my side bar, that appears in all pages (Blog and non-blog) of a site.  The listing is to have the blog title, a number limited synopsis of the content and a link.&lt;/p&gt;&lt;p&gt;However, it appears that I can't call &lt;em&gt;$Content.LimitWordCountXML(10)&lt;/em&gt; directly... Instead, I have use use &lt;em&gt;&amp;lt;% with Content %&amp;gt;$LimitWordCountXML(10)&amp;lt;% end_with %&amp;gt;&lt;/em&gt;.&lt;/p&gt;&lt;p&gt;Here is my code.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;In Page_Controller - Page.php:&lt;/strong&gt;&lt;br /&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;function LatestPosts($postLimit=3) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;   $latestPosts = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;   $blogHolderAvailable = BlogHolder::get();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;   if ($blogHolderAvailable) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   $latestPosts = BlogEntry::get()-&amp;gt;sort(&quot;Date&quot;, &quot;ASC&quot;)-&amp;gt;limit($postLimit);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;   }&amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;   return $latestPosts;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Template Snippet - doesn't work&lt;/strong&gt;&lt;br /&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;ul&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% loop $LatestPosts %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;li class=&quot;latestPostSynopsis&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;h4&amp;gt;$MenuTitle&amp;lt;/h4&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;p&amp;gt;$Content.LimitWordCountXML(10)...&amp;lt;/p&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;a href=&quot;$Link&quot; title=&quot;&amp;lt;% _t('VIEWFULL', 'View full post titled -') %&amp;gt; '$Title'&quot;&amp;gt;Read More&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% end_loop %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/ul&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;The above template outputs:&lt;br /&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;li&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;h4&amp;gt;MyMenu1&amp;lt;/h4&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;p&amp;gt;This is the full blog content that has been output instead of being word limited to 10.LimitWordCountXML(10)...&amp;lt;p&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;a href=&quot;/blog1&quot; title=&quot;Full blog1 title&quot;&amp;gt;Read More&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/li&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;When I replace &lt;em&gt;$Content.LimitWordCountXML(10)&lt;/em&gt; with &lt;em&gt;&amp;lt;% with Content %&amp;gt;$LimitWordCountXML(10)&amp;lt;% end_with %&amp;gt;&lt;/em&gt;, it works correctly.&lt;/p&gt;&lt;p&gt;Is it not possible to pass in parameters to a sub-property the way I have done it?  Do I need to enter into the scope of the property (&lt;em&gt;$Content&lt;/em&gt;) using &lt;em&gt;&amp;lt;% with %&amp;gt;&lt;/em&gt;to call methods and pass parameters?&lt;/p&gt;&lt;p&gt;Thank you.&lt;br /&gt;VWD.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Why does &amp;lt;% with Content %&amp;gt;$LimitWordCountXML(10)&amp;lt;% end_with %&amp;gt; but $Content.LimitWordCountXML(10) doesn&amp;#39;t | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23378&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23378&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Wed, 03 Apr 2013 11:51:15 +1300</pubDate>
			<dc:creator>vwd</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23378</guid>
		</item>
		
		<item>
			<title>Re: Displaying grandchildren pages in alphabetical order</title>
			<link>http://www.silverstripe.org/template-questions/show/23296#post321153</link>
			<description>&lt;p&gt;Hi Willr. Thanks for your quick reply. I've tried your suggestion but it's still not doing what I want. Using .Sort(Title) does sort the children, but only within the parent. So, while my cities are sorted within their country, I really want them sorted without reference to their country:&lt;/p&gt;&lt;p&gt;Current: ...Dublin, Killarney, Shannon, Florence, Milan, Rome Venice, Kyoto, Tokyo ...&lt;br /&gt;What I want: ...Dublin, Florence, Killarney, Kyoto, Milan, Rome, Shannon, Tokyo, Venice, ...&lt;/p&gt;&lt;p&gt;The parent countries aren't listed, so I'd like to have all the cities listed as one long alphabetised list.&lt;/p&gt;&lt;p&gt;Any suggestions?&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Displaying grandchildren pages in alphabetical order | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23296#post321153&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23296&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Wed, 03 Apr 2013 01:43:07 +1300</pubDate>
			<dc:creator>Strandoo</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23296#post321153</guid>
		</item>
		
		<item>
			<title>JavaScript in the Template</title>
			<link>http://www.silverstripe.org/template-questions/show/23365</link>
			<description>&lt;p&gt;I've looked up a couple ways to do this, but none work quite how I would like them to. I want to require JavaScript using the template, rather than the controller, so that I can put it in specific places. I'll have modernizr at the top and jquery + custom scripts at the bottom of the page. According to the documentation at &lt;a href=&quot;http://doc.silverstripe.org/framework/en/reference/requirements&quot; rel=&quot;nofollow&quot;&gt;http://doc.silverstripe.org/framework/en/reference/requirements&lt;/a&gt;, I should be able to do that with:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;% require javascript(cms/javascript/LeftAndMain.js) %&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;It can't seem to find it, I've tried several variations on that with different paths. The page loads, but where the script tag should be is just blank. I was able to get the scripts to load with:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;Requirements::javascript(&quot;themes/tcc/js/modernizr-2.6.2.min.js&quot;);&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;But that doesn't allow me to set the position. It also doesn't lend itself well to theme development, since it's outside of the template directory. I can also get it to work with a standard script tag:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;script src=&quot;/themes/tcc/js/jquery-1.9.1.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;But that doesn't really take advantage of the SilverStripe templating engine. Any suggestions?&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: JavaScript in the Template | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23365&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23365&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Tue, 02 Apr 2013 10:56:08 +1300</pubDate>
			<dc:creator>squarefighter</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23365</guid>
		</item>
		
		<item>
			<title>Re: Displaying grandchildren pages in alphabetical order</title>
			<link>http://www.silverstripe.org/template-questions/show/23296#post321036</link>
			<description>&lt;p&gt;While inside your Loop Menu(2) use &amp;lt;% loop Children %&amp;gt; to get the children of the 2nd level. If you want to sort you can use .Sort in templates - &amp;lt;% loop Children.Sort(Title) %&amp;gt;..&amp;lt;% end_loop %&amp;gt;&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Displaying grandchildren pages in alphabetical order | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23296#post321036&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23296&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Tue, 26 Mar 2013 20:03:38 +1300</pubDate>
			<dc:creator>Willr</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23296#post321036</guid>
		</item>
		
		<item>
			<title>Displaying grandchildren pages in alphabetical order</title>
			<link>http://www.silverstripe.org/template-questions/show/23296</link>
			<description>&lt;p&gt;Hi all,&lt;/p&gt;&lt;p&gt;I'm trying to display links to 'nephew' pages; i.e. sibling pages' children. The structure is like this:&lt;/p&gt;&lt;p&gt;Australia (CityHolder.ss)&lt;br /&gt;---Melbourne (City.ss)&lt;br /&gt;---Sydney&lt;br /&gt;Austria&lt;br /&gt;---Salzburg&lt;br /&gt;---Vienna&lt;br /&gt;Belgium&lt;br /&gt;---Brussels&lt;br /&gt;---Bruges&lt;br /&gt;etc.&lt;/p&gt;&lt;p&gt;When on any page, I'd like to display a list of countries and a list of cities (in a select menu) for navigation between all pages. The countries aren't a problem (using &amp;lt;% loop Menu(2) %&amp;gt;) but looping menu(3) just gives me the few sub-pages of a given country.&lt;/p&gt;&lt;p&gt;I've come close by using a sibling function found &lt;a href=&quot;https://github.com/mattclegg/silverstripe-doc-restructuring/blob/master/input/recipes/siblings.txt&quot; rel=&quot;nofollow&quot;&gt; here&lt;/a&gt;. This gives me a list of links, but they're listed by country, so it's a bit random looking:&lt;br /&gt;- Melbourne&lt;br /&gt;- Sydney&lt;br /&gt;- Salzburg&lt;br /&gt;- Vienna&lt;br /&gt;- Brussels&lt;br /&gt;- Bruges&lt;/p&gt;&lt;p&gt;Is there a way to output the list alphabetically? I'm a noob, so you may need to go in to some detail! Thanks in advance.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Displaying grandchildren pages in alphabetical order | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23296&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23296&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Tue, 26 Mar 2013 01:03:32 +1300</pubDate>
			<dc:creator>Strandoo</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23296</guid>
		</item>
		
		<item>
			<title>Menu font size</title>
			<link>http://www.silverstripe.org/template-questions/show/23291</link>
			<description>&lt;p&gt;I'm having trouble updating the menu on my website. How can i change the font size of the menu in the WINE theme?&lt;/p&gt;&lt;p&gt;The reason for this is because I've added a menu item and the contacts button has disappeared off the end of the menu, obviously can't fit it all on there at the moment. So i've concluded that I can either make the font smaller thereby allowing more to fit in, or I suspect that I can increase the width of the menu.&lt;/p&gt;&lt;p&gt;Either of these options would be good.... Can somebody give me a clue as to the way forward,&lt;/p&gt;&lt;p&gt;Cheers,&lt;/p&gt;&lt;p&gt;Andy&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Menu font size | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23291&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23291&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Sun, 24 Mar 2013 21:30:34 +1300</pubDate>
			<dc:creator>bettsaj</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23291</guid>
		</item>
		
		<item>
			<title>Re: Displaying country specific content</title>
			<link>http://www.silverstripe.org/template-questions/show/23137#post320881</link>
			<description>&lt;p&gt;Thanks for the reply.&lt;br /&gt;I have tried implementing your suggestion, however I don't seem to be able to access $CountryCode from within my Page control. If I type $Top.CountryCode I can see it, but this doesn't work within an 'if' condition.&lt;br /&gt;If I define CountryCode in the 'Page' class it works. But not sure if this is where I should be putting it?&lt;/p&gt;&lt;p&gt;To be clear, I have something like this:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;class Page extends SiteTree {&lt;br /&gt;    public $CountryCode = 'XX';&lt;br /&gt;}&lt;br /&gt;class Page_Controller extends ContentController {&lt;br /&gt;    public $CountryCode = 'YY';&lt;br /&gt;}&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;and putting something like this in my template:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;% control Page(mypage) %&amp;gt;&lt;br /&gt;    $CountryCode&lt;br /&gt;    $Top.CountryCode&lt;br /&gt;&amp;lt;% end_control %&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;outputs: XX YY&lt;/p&gt;&lt;p&gt;so &amp;lt;% if CountryCode == NZ %&amp;gt; would work only if I was defining my country code in Page and not PageController.&lt;br /&gt;and &amp;lt;% if Top.CountryCode == NZ %&amp;gt; seems to cause my page not to load.&lt;/p&gt;&lt;p&gt;Sorry if this is obvious stuff, but I am new to SilverStripe.&lt;br /&gt;Cheers.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Displaying country specific content | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23137#post320881&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23137&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Tue, 19 Mar 2013 10:42:25 +1300</pubDate>
			<dc:creator>dmeek</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23137#post320881</guid>
		</item>
		
		<item>
			<title>Re: Frontend forms - edit record like show record?</title>
			<link>http://www.silverstripe.org/template-questions/show/23049#post320831</link>
			<description>&lt;p&gt;Basically you want content editors who have no rights and who will not be able to mess things up and who will not be confused by all the options in the backend. So create a content editor login who can only view and edit pages, nothing more.&lt;/p&gt;&lt;p&gt;Then find the following files in /cms and change them. &lt;/p&gt;&lt;p&gt;# CMSMain_Content.ss&lt;br /&gt;Instead of &amp;lt;% include CMSBreadcrumbs %&amp;gt;:&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% if $CurrentMember.inGroup(2)  %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% include CMSBreadcrumbs %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% else %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;a href=&quot;/Security/logout&quot;&amp;gt;LOGOUT&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% end_if %&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;Last two links:&lt;br /&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% if $CurrentMember.inGroup(2)  %&amp;gt; ... &amp;lt;% end_if %&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;Instead of $Tools:&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% if $CurrentMember.inGroup(2)  %&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;$Tools&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% end_if %&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;#LeftAndMain.ss&lt;/p&gt;&lt;p&gt;Instead of $Menu:&lt;br /&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% if $CurrentMember.inGroup(2)  %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$Menu&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% end_if %&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;#Add edit this page and logout link to templates of pages that may be edited. &lt;br /&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;a href=&quot;admin/pages/edit/show/{$ID}&quot; title=&quot;edit this page&quot;&amp;gt;Edit this page&amp;lt;/a&amp;gt;&amp;lt;% if CurrentMember %&amp;gt; | &amp;lt;a href=&quot;/Security/logout&quot;&amp;gt;LOGOUT&amp;lt;/a&amp;gt;&amp;lt;% end_if %&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;These notes are based on the idea that the admin group is group 2. And it was tested with 3.0.2.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Frontend forms - edit record like show record? | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23049#post320831&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23049&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Sun, 17 Mar 2013 03:33:55 +1300</pubDate>
			<dc:creator>yurigoul</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23049#post320831</guid>
		</item>
		
		<item>
			<title>Re: Frontend forms - edit record like show record?</title>
			<link>http://www.silverstripe.org/template-questions/show/23049#post320830</link>
			<description>&lt;p&gt;Would like to know that myself, therefor bumped. The most important thing I would like to know is how to let users add pages from the front end.&lt;/p&gt;&lt;p&gt;The only thing I have found is a way to give a group of people access to one page at a time (without sitetree or tools) in the backend with lots of conditional hiding and showing. I will get back to that later.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Frontend forms - edit record like show record? | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23049#post320830&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23049&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Sun, 17 Mar 2013 03:10:54 +1300</pubDate>
			<dc:creator>yurigoul</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23049#post320830</guid>
		</item>
		
		<item>
			<title>Re: Displaying country specific content</title>
			<link>http://www.silverstripe.org/template-questions/show/23137#post320790</link>
			<description>&lt;p&gt;I think you need to simplify things.&lt;/p&gt;&lt;p&gt;You could put getCountry() in the init() method, so CountryCode is available immediately on page load.&lt;br /&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;class Page_Controller extends ContentController {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public $CountryCode = null;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public function init() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parent::init();&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$this-&amp;gt;CountryCode = $this-&amp;gt;getCountry();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;Then you could do:&lt;br /&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;% control Page(mypage) %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% if CountryCode == GB %&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% if ukContent %&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$ukContent &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% else %&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$Content &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% end_if %&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% else %&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$Content &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% end_if %&amp;gt;&lt;br /&gt;&amp;lt;% end_control %&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Displaying country specific content | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23137#post320790&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23137&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Sat, 16 Mar 2013 00:24:12 +1300</pubDate>
			<dc:creator>Devlin</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23137#post320790</guid>
		</item>
		
		<item>
			<title>Displaying country specific content</title>
			<link>http://www.silverstripe.org/template-questions/show/23137</link>
			<description>&lt;p&gt;I am having trouble displaying country specific content.&lt;br /&gt;I have a page (in this example called mypage) and it has some country specific content (called $ukContent). &lt;br /&gt;I have a php function that returns a country code (called getCountry()). &lt;br /&gt;In this situation 'mypage' can be a generic page that may or may not contain some country-specific content, so I need check both that the country code is UK and that there is specific uk content when i go to render the page.&lt;/p&gt;&lt;p&gt;Right now I have this:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;% control Page(mypage) %&amp;gt;&lt;br /&gt;        &amp;lt;% control Top.getCountry %&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;% if CountryCode == GB %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% if ukContent %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$ukContent&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% else %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$content&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% end_if %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;% else %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$content&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;% end_if %&amp;gt;&lt;/p&gt;&lt;p&gt;        &amp;lt;% end_control %&amp;gt;&lt;br /&gt;    &amp;lt;% end_control %&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;My problem is that once  I go into the 'Top.getCountry' section, I no longer have access to the $ukContent variable (from the 'Page(mypage)' section').&lt;br /&gt;Is there a better way of handling country-specific content? Ideally the solution would allow me to continue the pattern of having optional country-specific content variables on each of my pages.&lt;/p&gt;&lt;p&gt;Any help would be much appreciated.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Displaying country specific content | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23137&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23137&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Fri, 15 Mar 2013 16:22:29 +1300</pubDate>
			<dc:creator>dmeek</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23137</guid>
		</item>
		
		<item>
			<title>Re: Custom HTML Code / Javascript inserted via CMS</title>
			<link>http://www.silverstripe.org/template-questions/show/18573?start=8#post320665</link>
			<description>&lt;p&gt;For the future - may be useful to someone&lt;/p&gt;&lt;p&gt;Use a:&lt;br /&gt;- Text or Varchar&lt;/p&gt;&lt;p&gt;In CMSfield normaly like: &lt;br /&gt;- new TextAreaField&lt;br /&gt;- newTextField&lt;/p&gt;&lt;p&gt;In template&lt;br /&gt;$NameField.RAW&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Custom HTML Code / Javascript inserted via CMS | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/18573?start=8#post320665&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/18573&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Wed, 13 Mar 2013 02:23:13 +1300</pubDate>
			<dc:creator>Craftnet</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/18573?start=8#post320665</guid>
		</item>
		
		<item>
			<title>Re: How to call/show a template in a lightbox witohut the theme (plain/raw view)</title>
			<link>http://www.silverstripe.org/template-questions/show/22985#post320650</link>
			<description>&lt;p&gt;OK, I implemented fancybox for the lightbox.&lt;/p&gt;&lt;p&gt;I then, on each lightbox link, added a param ?modal=1 and grabbed this from the page.php and used it to show/hide elements in the page.ss so that existing templates extending 'page' can carry on doing so but without the themes header and footer etc.&lt;/p&gt;&lt;p&gt;Hope this helps somebody with similar query.&lt;/p&gt;&lt;p&gt;K...&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: How to call/show a template in a lightbox witohut the theme (plain/raw view) | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/22985#post320650&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/22985&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Tue, 12 Mar 2013 03:28:57 +1300</pubDate>
			<dc:creator>kharmer</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/22985#post320650</guid>
		</item>
		
		<item>
			<title>Frontend forms - edit record like show record?</title>
			<link>http://www.silverstripe.org/template-questions/show/23049</link>
			<description>&lt;p&gt;Hi all,&lt;/p&gt;&lt;p&gt;I'm gradually getting to grips with SilverStripe. Currently building a load of frontend pages for specific admins to add new records to custom DB tables and found the '_show' suffix for showing a single record (i.e. 'record-details/show/23/' where 23 is record ID).&lt;/p&gt;&lt;p&gt;Is there something similar for editing a record in the frontend?&lt;/p&gt;&lt;p&gt;Best regards,&lt;br /&gt;K...&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Frontend forms - edit record like show record? | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/23049&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/23049&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Tue, 12 Mar 2013 03:26:15 +1300</pubDate>
			<dc:creator>kharmer</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/23049</guid>
		</item>
		
		<item>
			<title>How to call/show a template in a lightbox witohut the theme (plain/raw view)</title>
			<link>http://www.silverstripe.org/template-questions/show/22985</link>
			<description>&lt;p&gt;Hi all,&lt;/p&gt;&lt;p&gt;How would I call, from one template, another template inside a light box. And without the theme warapped around it?&lt;/p&gt;&lt;p&gt;I have a list page and a button to Add a new item and would like the page for adding new item to be displayed to user in lightbox from the listing page (to make workflow faster).&lt;/p&gt;&lt;p&gt;I tried searching but didnt have any joy finding what I needed! If anyone has some handy tips or references on the web I'd really appreciate them.&lt;/p&gt;&lt;p&gt;Best regards,&lt;br /&gt;K...&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: How to call/show a template in a lightbox witohut the theme (plain/raw view) | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/22985&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/22985&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Fri, 08 Mar 2013 05:07:51 +1300</pubDate>
			<dc:creator>kharmer</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/22985</guid>
		</item>
		
		<item>
			<title>Re: Reference subarray data from template (SS 2.4)</title>
			<link>http://www.silverstripe.org/template-questions/show/22834#post320538</link>
			<description>&lt;p&gt;Thanks Willr - thats was enough to get me moving again.  All sorted now thanks.&lt;/p&gt;&lt;p&gt;K...&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Reference subarray data from template (SS 2.4) | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/22834#post320538&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/22834&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Wed, 06 Mar 2013 04:17:54 +1300</pubDate>
			<dc:creator>kharmer</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/22834#post320538</guid>
		</item>
		
		<item>
			<title>Re: Custom HTML Code / Javascript inserted via CMS</title>
			<link>http://www.silverstripe.org/template-questions/show/18573?start=8#post320516</link>
			<description>&lt;p&gt;I dont know if this got resolved, or if its written somewhere else but this is my FIX:&lt;/p&gt;&lt;p&gt;Use a:&lt;br /&gt;HTMLText&lt;br /&gt;TextareaField&lt;/p&gt;&lt;p&gt;Then in the CMS wrap your pasted code in:&lt;br /&gt;&amp;lt;!-- MYcode --&amp;gt;&lt;br /&gt;YOUR CODE HERE&lt;br /&gt;&amp;lt;!--End MYcode--&amp;gt;&lt;/p&gt;&lt;p&gt;So for example my Rebel Mouse page this is my code:&lt;/p&gt;&lt;p&gt;RebelMousePage.php&lt;br /&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;?php&lt;br /&gt;class RebelMousePage extends Page {&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public static $db = array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;'RebelMouseCode' =&amp;gt; 'HTMLText'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;);&lt;/p&gt;&lt;p&gt;public function getCMSFields() {&lt;/p&gt;&lt;p&gt;        $fields = parent::getCMSFields(); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$fields-&amp;gt;addFieldToTab('Root.RebelMouseCode', TextAreaField::create('RebelMouseCode','Paste Your Rebel Mouse Code Here: '));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return $fields;         &lt;br /&gt;    }   &lt;/p&gt;&lt;p&gt;}&lt;br /&gt;class RebelMousePage_Controller extends Page_Controller {&lt;br /&gt;}&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;And in the CMS:&lt;/p&gt;&lt;p&gt;&amp;lt;!-- RebelMouse --&amp;gt;&lt;br /&gt;&amp;lt;script type=&quot;text/javascript&quot; id=&quot;rebelmouse-embed-script&quot; src=&quot;https://www.rebelmouse.com/static/js-build/embed/embed.js?site=USER&amp;amp;amp;height=1500&amp;amp;amp;flexible=1&amp;amp;amp;skip=about-site,show_rebelnav&quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;!--End RebelMouse--&amp;gt;&lt;/p&gt;&lt;p&gt;In the RebelMousePage.ss&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;$RebelMouseCode&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;hope this helps someone!&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Custom HTML Code / Javascript inserted via CMS | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/18573?start=8#post320516&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/18573&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Tue, 05 Mar 2013 00:21:47 +1300</pubDate>
			<dc:creator>pinkp</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/18573?start=8#post320516</guid>
		</item>
		
		<item>
			<title>Re: *SOLVED* - Can&#39;t seem to use Summary() and other data function on Virtual page properties</title>
			<link>http://www.silverstripe.org/template-questions/show/22911#post320512</link>
			<description>&lt;p&gt;This is turning into a bit of a nightmare actually. After doing the above, I cannot find a way to provide the loop with the virtual page's $Link and $ID. Obviously the new method is returning the object of the page the virtual one derives from, but there doesn't seem to be a way to return a mix of the virtual page properties and the real page's properties that actually support using the built in methods.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: *SOLVED* - Can&amp;#39;t seem to use Summary() and other data function on Virtual page properties | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/22911#post320512&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/22911&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Mon, 04 Mar 2013 21:24:53 +1300</pubDate>
			<dc:creator>Double-A-Ron</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/22911#post320512</guid>
		</item>
		
		<item>
			<title>Re: *SOLVED* - Can&#39;t seem to use Summary() and other data function on Virtual page properties</title>
			<link>http://www.silverstripe.org/template-questions/show/22911#post320511</link>
			<description>&lt;p&gt;Found the solution to this, and it seems that this is a Framework limitation.&lt;/p&gt;&lt;p&gt;I had to replace $Children with a custom method in the holder class file that detected if the current child was a virtual page, and load the real data object from the master content ID.&lt;/p&gt;&lt;p&gt;MyHolder.php - MyHolderController Class&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;public function realPages() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$children = $this-&amp;gt;Children(); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$return = new DataObjectSet(); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach ($children as $child) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if($child-&amp;gt;ClassName == 'VirtualPage') {&lt;br /&gt;                                // Current child is virtual, get the real page&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$virtualPage = DataObject::get_by_id('VirtualPage', $child-&amp;gt;ID); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$realPage = DataObject::get_by_id('Page', $virtualPage-&amp;gt;CopyContentFromID);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;br /&gt;                                // Current child is real, just use it as it is&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$realPage = $child;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   $return-&amp;gt;push($realPage); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return $return; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;Then in the template change&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;% control Children %&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;To:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;% control realPages %&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;The one thing with this is that the URL link and ID is that of the Virtual pages master, so I have to come up with some funky setters there.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: *SOLVED* - Can&amp;#39;t seem to use Summary() and other data function on Virtual page properties | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/22911#post320511&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/22911&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Mon, 04 Mar 2013 20:22:08 +1300</pubDate>
			<dc:creator>Double-A-Ron</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/22911#post320511</guid>
		</item>
		
		<item>
			<title>*SOLVED* - Can&#39;t seem to use Summary() and other data function on Virtual page properties</title>
			<link>http://www.silverstripe.org/template-questions/show/22911</link>
			<description>&lt;p&gt;Version 2.4&lt;/p&gt;&lt;p&gt;I have a virtual page derived from a normal page. This normal page has a text field. You could even take the default Content field on a page as an example.&lt;/p&gt;&lt;p&gt;I then have a holder page to display a list of these pages and allow the user to click through to the page itself. This holder loops these using:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;% control Children %&amp;gt;&lt;br /&gt;    $Content.Summary(40).&lt;br /&gt;&amp;lt;% end_control %&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;In the template, I am truncating the text in Content using $Content.Summary(40).&lt;/p&gt;&lt;p&gt;This works as expected where the child is a real data object. But when it is a virtual page, the output is blank. However in these cases if I just change the template to be $Content (without calling Summary), the text is output in full.&lt;/p&gt;&lt;p&gt;I found that the above is true for any native function supported by the datatype (in this case, and HTMLField)&lt;/p&gt;&lt;p&gt;Is this a framework limitation? Is there a workaround?&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: *SOLVED* - Can&amp;#39;t seem to use Summary() and other data function on Virtual page properties | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/22911&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/22911&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Mon, 04 Mar 2013 19:30:15 +1300</pubDate>
			<dc:creator>Double-A-Ron</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/22911</guid>
		</item>
		
		<item>
			<title>Re: start position of the loop</title>
			<link>http://www.silverstripe.org/template-questions/show/22851#post320469</link>
			<description>&lt;p&gt;Thanks. Exactly what i need.&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: start position of the loop | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/22851#post320469&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/22851&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Fri, 01 Mar 2013 11:28:17 +1300</pubDate>
			<dc:creator>felito</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/22851#post320469</guid>
		</item>
		
		<item>
			<title>Re: Reference subarray data from template (SS 2.4)</title>
			<link>http://www.silverstripe.org/template-questions/show/22834#post320441</link>
			<description>&lt;p&gt;Products should be wrapped in an ArrayList object so it's iterable. Once you do that, you can do &amp;lt;% control Products %&amp;gt;&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Reference subarray data from template (SS 2.4) | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/22834#post320441&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/22834&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Thu, 28 Feb 2013 20:56:23 +1300</pubDate>
			<dc:creator>Willr</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/22834#post320441</guid>
		</item>
		
		<item>
			<title>Re: start position of the loop</title>
			<link>http://www.silverstripe.org/template-questions/show/22851#post320439</link>
			<description>&lt;p&gt;Modulus doesn't work like that (&lt;a href=&quot;http://en.wikipedia.org/wiki/Modular_arithmetic&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Modular_arithmetic&lt;/a&gt;).&lt;/p&gt;&lt;p&gt;If you want to alter the start to skip the first 4, one way you could do is use Limit() - &amp;lt;% loop $Menu(1).Limit(100, 4) %&amp;gt;&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: start position of the loop | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/22851#post320439&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/22851&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Thu, 28 Feb 2013 20:48:04 +1300</pubDate>
			<dc:creator>Willr</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/22851#post320439</guid>
		</item>
		
		<item>
			<title>start position of the loop</title>
			<link>http://www.silverstripe.org/template-questions/show/22851</link>
			<description>&lt;p&gt;I have this code, and if the pagetype is page, i want to start the loop at the position 4. I am trying $modulus, but the result is not the expected.&lt;/p&gt;&lt;p&gt;This should be simple, right?&lt;/p&gt;&lt;p&gt;&amp;lt;% if ClassName = Page %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% loop $Menu(1) %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% if not $Modulus(5) %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;li class=&quot;$LinkingMode triangle-isosceles top buble-$Pos&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;a href=&quot;$Link&quot; title=&quot;$Title.XML&quot;&amp;gt;$MenuTitle.XML&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% end_if %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% end_loop %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% end_if %&amp;gt;&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: start position of the loop | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/22851&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/22851&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Thu, 28 Feb 2013 14:08:14 +1300</pubDate>
			<dc:creator>felito</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/22851</guid>
		</item>
		
		<item>
			<title>Registrable Event Template</title>
			<link>http://www.silverstripe.org/template-questions/show/22850</link>
			<description>&lt;p&gt;Hi there,&lt;/p&gt;&lt;p&gt;I want to style the template for the Registrable Events to look the same as the Calendar Events template but it defaults to the Page.ss template.&lt;/p&gt;&lt;p&gt;Is there  a way that I can make the Calendar.ss template the default for the Registrable Events? &lt;/p&gt;&lt;p&gt;Alternatively there is the RegistrableEvent.ss template, which I have tried to style, but for some reason it doesn't seem to use this template.&lt;/p&gt;&lt;p&gt;Cheers&lt;/p&gt;&lt;p&gt;Natalie&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Registrable Event Template | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/22850&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/22850&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Thu, 28 Feb 2013 14:04:41 +1300</pubDate>
			<dc:creator>nat.pike</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/22850</guid>
		</item>
		
		<item>
			<title>Reference subarray data from template (SS 2.4)</title>
			<link>http://www.silverstripe.org/template-questions/show/22834</link>
			<description>&lt;p&gt;Hi All,&lt;/p&gt;&lt;p&gt;I am quite new to SS, so this might be a silly question!&lt;/p&gt;&lt;p&gt;I have in my template a dataset that, when dumped to screen, looks like this:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;Array&lt;br /&gt;(&lt;br /&gt;....[0] =&amp;gt; ArrayData Object&lt;br /&gt;........(&lt;br /&gt;............[array:protected] =&amp;gt; Array&lt;br /&gt;................(&lt;br /&gt;....................[FirstName] =&amp;gt; Agent 1&lt;br /&gt;....................[LastName] =&amp;gt; Agent 1&lt;br /&gt;....................[AgentDistributor] =&amp;gt; Distributor 1&lt;br /&gt;....................[products] =&amp;gt; Array&lt;br /&gt;........................(&lt;br /&gt;............................[0] =&amp;gt; Array&lt;br /&gt;................................(&lt;br /&gt;....................................[ProductID] =&amp;gt; 11&lt;br /&gt;....................................[ProductName] =&amp;gt; Product1&lt;br /&gt;....................................[Quantity] =&amp;gt; 15&lt;br /&gt;................................)&lt;/p&gt;&lt;p&gt;............................[1] =&amp;gt; Array&lt;br /&gt;................................(&lt;br /&gt;....................................[ProductID] =&amp;gt; 11&lt;br /&gt;....................................[ProductName] =&amp;gt; Product1&lt;br /&gt;....................................[Quantity] =&amp;gt; 15&lt;br /&gt;................................)&lt;/p&gt;&lt;p&gt;........................)&lt;/p&gt;&lt;p&gt;................)&lt;/p&gt;&lt;p&gt;............[iteratorPos:protected] =&amp;gt; &lt;br /&gt;............[iteratorTotalItems:protected] =&amp;gt; &lt;br /&gt;............[failover:protected] =&amp;gt; &lt;br /&gt;............[customisedObject:protected] =&amp;gt; &lt;br /&gt;............[objCache:ViewableData:private] =&amp;gt; Array&lt;br /&gt;................(&lt;br /&gt;................)&lt;/p&gt;&lt;p&gt;............[class] =&amp;gt; ArrayData&lt;br /&gt;............[extension_instances:protected] =&amp;gt; Array&lt;br /&gt;................(&lt;br /&gt;................)&lt;/p&gt;&lt;p&gt;........)&lt;/p&gt;&lt;p&gt;....[1] =&amp;gt; ArrayData Object&lt;br /&gt;........(&lt;br /&gt;............[array:protected] =&amp;gt; Array&lt;br /&gt;................(&lt;br /&gt;....................[FirstName] =&amp;gt; Agent 2&lt;br /&gt;                    ............&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;Now, using &amp;lt;% control AgentsResults %&amp;gt; I can loop through the data as expected. However, I am trying to loop through the products sub-array using a nested &amp;lt;? control ?&amp;gt;. Of course this doesn't work, hence I am here.&lt;/p&gt;&lt;p&gt;I found references to &amp;lt;? control Children ?&amp;gt; but this doesn't appear to work!&lt;/p&gt;&lt;p&gt;Could anyone suggest the correct way to go about this, taking into account I am forced to run SS 2.4!&lt;/p&gt;&lt;p&gt;Best regards,&lt;br /&gt;K...&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Reference subarray data from template (SS 2.4) | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/22834&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/22834&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Thu, 28 Feb 2013 03:51:16 +1300</pubDate>
			<dc:creator>kharmer</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/22834</guid>
		</item>
		
		<item>
			<title>Nested Image Controls</title>
			<link>http://www.silverstripe.org/template-questions/show/22806</link>
			<description>&lt;p&gt;How can i nest a control in my loop:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;% loop Images %&amp;gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;div class=&quot;GalleryImage&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;span&amp;gt;&amp;lt;h3&amp;gt;$ImageTitle&amp;lt;/h3&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;a class=&quot;fancybox&quot; data-fancybox-group=&quot;gallery&quot; href=&quot;$Filename&quot; title=&quot;$ImageTitle  $ImageSubTitle&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;$CroppedImage({$Top.WidthImage})&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;% end_loop %&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;This does't work, I want to have a cropped image and allow the user to control the sizes in the CMS.&lt;/p&gt;&lt;p&gt;$CroppedImage(280,140)&lt;br /&gt;$CroppedImage({$Top.WidthImage})&lt;/p&gt;&lt;p&gt;thanks&lt;/p&gt;

&lt;br /&gt;
&lt;p&gt;Posted to: Nested Image Controls | &lt;a href=&quot;http://www.silverstripe.org/template-questions/show/22806&quot; class=&quot;showLink&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/template-questions/reply/22806&quot; class=&quot;replyLink&quot;&gt;Post Reply&lt;/a&gt;&lt;/p&gt;
</description>
			<pubDate>Tue, 26 Feb 2013 23:42:56 +1300</pubDate>
			<dc:creator>pinkp</dc:creator>
			<guid>http://www.silverstripe.org/template-questions/show/22806</guid>
		</item>
		

	</channel>
</rss>