<?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>Netzelf Blog &#187; Smarty</title>
	<atom:link href="http://blog.netzelf.de/lang/en/tag/smarty/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.netzelf.de</link>
	<description>Ein weiteres tolles WordPress-Blog</description>
	<lastBuildDate>Mon, 19 Sep 2011 22:31:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Automatic category images in XTCommerce</title>
		<link>http://blog.netzelf.de/lang/en/tipps-und-tricks/automatische-kategoriebilder-in-xtcommerce</link>
		<comments>http://blog.netzelf.de/lang/en/tipps-und-tricks/automatische-kategoriebilder-in-xtcommerce#comments</comments>
		<pubDate>Mon, 05 May 2008 16:56:26 +0000</pubDate>
		<dc:creator>Christian Opitz</dc:creator>
				<category><![CDATA[Tips and tricks]]></category>
		<category><![CDATA[XTCommerce]]></category>
		<category><![CDATA[Automatisierung]]></category>
		<category><![CDATA[Kategoriebilder]]></category>
		<category><![CDATA[Smarty]]></category>

		<guid isPermaLink="false">http://block.netzelf.de/?p=4</guid>
		<description><![CDATA[Not everyone who uses a XTC system has the time to set a category image for each category &#8211; just as if you have a quiet complex category structure. Apart from that the native XTC category image function has a further problem: The images have to be uploaded for each category. What next if you [...]]]></description>
			<content:encoded><![CDATA[


<p><span lang="en">Not everyone who uses a XTC system has the time to set a category image for each category &#8211; just as if you have a quiet complex category structure.</span></p>
<p><span lang="en">Apart from that the native XTC category image function has a further problem: The images have to be uploaded for each category. What next if you used a product image for a category and the product later possibly does&#8217;nt exist in this category anymore?</span></p>
<p><span lang="en">That&#8217;s why i prefer the automatic output of category images. Where do this images come from? They are product images from a product within the category.</span><span id="more-4"></span></p>



<p><span lang="en">While it&#8217;s quiet complicated to extend XTC with functions like these there is another relatively comfortable way: Through Smarty plugins.</span></p>
<p><span lang="en">The well documented and flexible parsing engine allows to use different plugins and to extend XTC without hacking any core files.</span></p>
<p><span lang="en">How does it work?</span></p>


<p><span lang="en"><strong>Step 1/2 &#8211; install the plugin</strong></span></p>
<p><span lang="en">Download the Smarty plugin <a href="http://blog.netzelf.de/wp-content/uploads/2008/05/modifierauto_category_image.zip">here</a> and extract the file to the directory <em>[XTC-Wurzelverzeichnis]/includes/classes/Smarty_2.6.14/plugins/</em> on your server.</span></p>









<p><span lang="en"><strong>Schritt 2/2 &#8211; Customise your template</strong></span></p>
<p><span lang="en">Open the file</span></p>
<p><span lang="en"><em>[XTC-root directory]/templates/[Your Template]/module/categorie_listing/categorie_listing.html</em></span></p>
<p><span lang="en">find this line</span></p>
<div class="code"><span lang="en">{if $module_data.CATEGORIES_IMAGE} &#60;a href=&#8221;{$module_data.CATEGORIES_LINK}&#8221;&#62;&#60;img src=&#8221;{$module_data.CATEGORIES_IMAGE}&#8221; alt=&#8221;{$module_data.CATEGORIES_NAME}&#8221; /&#62;&#60;/a&#62;{/if}</span></div>
<p><span lang="en">and comment it out. (Simply insert {* before and *} after)</span></p>
<p><span lang="en">After this line insert:</span></p>
<div class="code"><span lang="en">&#60;a href=&#8221;{$module_data.CATEGORIES_LINK}&#8221;&#62;&#60;img src=&#8221;{$module_data.CATEGORIES_LINK&#124;auto_category_image:true}&#8221; alt=&#8221;" /&#62;&#60;/a&#62;</span></div>
<p><span lang="en">and save the file.</span></p>



<p><span lang="en"><strong>Ready</strong></span></p>
<p><span lang="en">The attribute ready stands for the automatic output. It&#8217;s your choice to set it to <strong>true</strong> to output the image at random or to <strong>false</strong> to output first found image.</span></p>
<p><span lang="en"><strong>Attention:</strong> This script searches the database recursively for product images. So if you have a large amount of nested sub categorys without product images within you should not use this script for perfomance reasons.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.netzelf.de/lang/en/tipps-und-tricks/automatische-kategoriebilder-in-xtcommerce/feed</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
	</channel>
</rss>

