<?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: Check if image exists in template</title>
			<link>http://www.silverstripe.org/archive/show/162351?start=0#post162456</link>
			<description>&lt;p&gt;&amp;lt;% if BannerImage %&amp;gt; &lt;br /&gt;Render html specific if bannerimage exists &lt;br /&gt;&amp;lt;% else %&amp;gt; &lt;br /&gt;Render html for no image &lt;br /&gt;&amp;lt;% end if %&amp;gt;&lt;/p&gt;&lt;p&gt;Should work fine!&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Check if image exists in template &lt;a href=&quot;http://www.silverstripe.org/archive/show/162351?start=0#post162456&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/162351?start=0#post162456&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Sun, 07 Sep 2008 11:29:59 +1200</pubDate>
			<dc:creator>willr</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/162351?start=0#post162456</guid>
		</item>
		
		<item>
			<title>Re: Check if image exists in template</title>
			<link>http://www.silverstripe.org/archive/show/162351?start=0#post162405</link>
			<description>&lt;p&gt;Hmmm. You could try this:&lt;/p&gt;&lt;p&gt;1) Make a Page called &quot;bannerimage&quot; with the html for the banner.&lt;br /&gt;2) use this in your page.ss file&lt;/p&gt;&lt;p&gt;&amp;lt;% if Page(bannerimage) %&amp;gt;&lt;br /&gt;$Content&lt;br /&gt;&amp;lt;% else %&amp;gt;&lt;br /&gt;render html for no img&lt;br /&gt;&amp;lt;% end_if %&amp;gt;&lt;/p&gt;&lt;p&gt;This might work, it might not work, I'm not sure.&lt;/p&gt;&lt;p&gt;**edit**&lt;br /&gt;If that doesnt work, try this:&lt;/p&gt;&lt;p&gt;&amp;lt;% if Page(bannerimage) %&amp;gt;&lt;br /&gt;&amp;lt;% control Page(bannerimage) %&amp;gt;&lt;br /&gt;$Content&lt;br /&gt;&amp;lt;% end_control %&amp;gt;&lt;br /&gt;&amp;lt;% else %&amp;gt;&lt;br /&gt;render html for no img&lt;br /&gt;&amp;lt;% end_if %&amp;gt;&lt;/p&gt;&lt;p&gt;**edit**&lt;br /&gt;Don't forget to go to the behavior tab of the &quot;bannerimage&quot; page, and turn off &quot;show in menus&quot; and &quot;show in searches&quot;&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Check if image exists in template &lt;a href=&quot;http://www.silverstripe.org/archive/show/162351?start=0#post162405&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/162351?start=0#post162405&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Sun, 07 Sep 2008 09:40:32 +1200</pubDate>
			<dc:creator>grilldan</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/162351?start=0#post162405</guid>
		</item>
		
		<item>
			<title>Check if image exists in template</title>
			<link>http://www.silverstripe.org/archive/show/162351#post162351</link>
			<description>&lt;p&gt;Hi, i'm new to PHP and Silverstripe, but using it to build a site right now and so far i like the flexibility alot. Question: &lt;br /&gt;I have extended my page to include an ImageField (followed the tutorial) and i want to use the image as a banner on the page if there is an image attached. How do i check if an image exists in the template? Sort of like this:&lt;/p&gt;&lt;p&gt;&amp;lt;% if BannerImage %&amp;gt;&lt;br /&gt;Render html specific if bannerimage exists&lt;br /&gt;&amp;lt;% else %&amp;gt;&lt;br /&gt;Render html for no image&lt;br /&gt;&amp;lt;% end if %&amp;gt;&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Check if image exists in template &lt;a href=&quot;http://www.silverstripe.org/archive/show/162351#post162351&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/show/162351#post162351&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Sun, 07 Sep 2008 08:10:30 +1200</pubDate>
			<dc:creator>Fredrik</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/162351#post162351</guid>
		</item>
		

	</channel>
</rss>