<?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>Forum posts to 'Archive'</title>
		<link>http://www.silverstripe.org/archive/rss</link>
		<atom:link href="http://www.silverstripe.org/archive/rss" rel="self" type="application/rss+xml" />
		<description></description>

		
		<item>
			<title>Re: Little Help with if statements</title>
			<link>http://www.silverstripe.org/archive/show/104417?start=0#post104582</link>
			<description>&lt;p&gt;Oh and to answer your question, no, you can't use PHP in a template. This forces you to use the MVC model the way you should.&lt;/p&gt;&lt;p&gt;Cheers&lt;br /&gt;Aaron&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Little Help with if statements &lt;a href=&quot;http://www.silverstripe.org/archive/show/104417?start=0#post104582&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/104417?start=0#post104582&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Tue, 24 Jun 2008 09:14:46 +1200</pubDate>
			<dc:creator>Double-A-Ron</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/104417?start=0#post104582</guid>
		</item>
		
		<item>
			<title>Re: Little Help with if statements</title>
			<link>http://www.silverstripe.org/archive/show/104417?start=0#post104575</link>
			<description>&lt;p&gt;Ahh well that makes sense!  Thanks for the heads up!!&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Little Help with if statements &lt;a href=&quot;http://www.silverstripe.org/archive/show/104417?start=0#post104575&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/104417?start=0#post104575&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Tue, 24 Jun 2008 09:00:55 +1200</pubDate>
			<dc:creator>3N1GM4</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/104417?start=0#post104575</guid>
		</item>
		
		<item>
			<title>Re: Little Help with if statements</title>
			<link>http://www.silverstripe.org/archive/show/104417?start=0#post104557</link>
			<description>&lt;p&gt;What you should do is in the Page_Controller class for that page type, create a new function that does the calculation and returns a boolean to your template. Something like:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;function FunctionName() {&lt;br /&gt;   if($this-&amp;gt;TotalItems - $this-&amp;gt;Pos == 6) {&lt;br /&gt;      return true;&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;Note, I am unsure what TotalItems and Pos actually are, but I am assuming they are part of the page object if you are referencing them in the template.&lt;/p&gt;&lt;p&gt;So, then, in your template:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;lt;% if FunctionName %&amp;gt;&lt;br /&gt;... do this code ...&lt;br /&gt;&amp;lt;% end_if %&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;The idea is to remove such logic from your template and always handle it in your controller. &lt;/p&gt;&lt;p&gt;Cheers&lt;br /&gt;Aaron&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Little Help with if statements &lt;a href=&quot;http://www.silverstripe.org/archive/show/104417?start=0#post104557&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/104417?start=0#post104557&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Tue, 24 Jun 2008 08:48:53 +1200</pubDate>
			<dc:creator>Double-A-Ron</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/104417?start=0#post104557</guid>
		</item>
		
		<item>
			<title>Little Help with if statements</title>
			<link>http://www.silverstripe.org/archive/show/104417#post104417</link>
			<description>&lt;p&gt;Hello All!&lt;/p&gt;&lt;p&gt;Im trying to do something like this&lt;/p&gt;&lt;p&gt;&amp;lt;% if TotalItems - Pos = 6 %&amp;gt;&lt;br /&gt;     ... do this code ...&lt;br /&gt;&amp;lt;% end_if %&amp;gt;&lt;/p&gt;&lt;p&gt;but keep getting an error. is there a way to do PHP style if statements in a template?&lt;/p&gt;&lt;p&gt;as in &amp;lt;= , &amp;gt;= , % , ect.&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Little Help with if statements &lt;a href=&quot;http://www.silverstripe.org/archive/show/104417#post104417&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/show/104417#post104417&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Tue, 24 Jun 2008 04:54:07 +1200</pubDate>
			<dc:creator>3N1GM4</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/104417#post104417</guid>
		</item>
		

	</channel>
</rss>