<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dootch &#187; page_image</title>
	<atom:link href="http://www.dootch.com/tag/page_image/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dootch.com</link>
	<description>Perspectives of a freelancer and entrepreneur</description>
	<lastBuildDate>Sun, 05 Feb 2012 01:32:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Serving a different image for each page in CMSMS</title>
		<link>http://www.dootch.com/2010/07/serving-a-different-image-for-each-page-in-cmsms/</link>
		<comments>http://www.dootch.com/2010/07/serving-a-different-image-for-each-page-in-cmsms/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 01:41:09 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[cmsms]]></category>
		<category><![CDATA[page_image]]></category>

		<guid isPermaLink="false">http://www.dootch.com/?p=673</guid>
		<description><![CDATA[In one of the sites I&#8217;m working on, there is a large featured image that is different for each product page, but is the same for the rest of the pages on the site. Heres how I did it. 1. In each page where you need a different featured image, go to the options tab, [...]


Related posts:<ol><li><a href='http://www.dootch.com/2010/08/this-category-is-empty-message-in-cmsms-products-module/' rel='bookmark' title='Permanent Link: &#8220;This category is empty&#8221; message in CMSMS Products module'>&#8220;This category is empty&#8221; message in CMSMS Products module</a></li>
<li><a href='http://www.dootch.com/2010/04/seo-friendly-titles-for-modules-in-cmsms/' rel='bookmark' title='Permanent Link: SEO Friendly titles for modules in CMSMS'>SEO Friendly titles for modules in CMSMS</a></li>
<li><a href='http://www.dootch.com/2010/08/how-to-setup-a-template-in-cmsms/' rel='bookmark' title='Permanent Link: How to setup a template in CMSMS'>How to setup a template in CMSMS</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In one of the sites I&#8217;m working on, there is a large featured image that is different for each product page, but is the same for the rest of the pages on the site.</p>
<p>Heres how I did it.</p>
<p>1. In each page where you need a different featured image, go to the options tab, and set the Image variable</p>
<p>2. This variables is accessible in the menu manager as $node-&gt;image. To use them in a template, you can use the tag {page_image}. However, I needed to be able to check if there was an image because if there is no image set, I wanted to be able to have a default image. Since {page_image} is a tag and not a variable, you can&#8217;t just do isset(page_image). Instead, you first need to assign it&#8217;s output to an image.</p>
<p>You can do that like this:</p>
<p><code>{capture name="is_page" assign='is_page_image'}{page_image}{/capture}</code></p>
<p>3. Now that we have a variable, we can check if the page we&#8217;re on has an image, and then display the image. If it doesn&#8217;t, we can display our default image.</p>
<p><code>{if ($is_page_image ne '')}<br />
&lt;a href="#"&gt;&lt;img src="uploads/images/{page_image}" alt="{title}" width="870" height="382" /&gt;&lt;/a&gt;<br />
{else}<br />
&lt;a href="#"&gt;&lt;img src="images/img-ad.jpg" alt="default image description" width="870" height="382" /&gt;&lt;/a&gt;<br />
{/if}</code></p>
<p>4. Done! Now on each page, the page image is displayed, and if there isn&#8217;t one, a default image is displayed.</p>


<p>Related posts:<ol><li><a href='http://www.dootch.com/2010/08/this-category-is-empty-message-in-cmsms-products-module/' rel='bookmark' title='Permanent Link: &#8220;This category is empty&#8221; message in CMSMS Products module'>&#8220;This category is empty&#8221; message in CMSMS Products module</a></li>
<li><a href='http://www.dootch.com/2010/04/seo-friendly-titles-for-modules-in-cmsms/' rel='bookmark' title='Permanent Link: SEO Friendly titles for modules in CMSMS'>SEO Friendly titles for modules in CMSMS</a></li>
<li><a href='http://www.dootch.com/2010/08/how-to-setup-a-template-in-cmsms/' rel='bookmark' title='Permanent Link: How to setup a template in CMSMS'>How to setup a template in CMSMS</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dootch.com/2010/07/serving-a-different-image-for-each-page-in-cmsms/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

