<?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>Webdevelopment at huuah.com &#187; TemplaVoila</title>
	<atom:link href="http://huuah.com/category/templavoila/feed/" rel="self" type="application/rss+xml" />
	<link>http://huuah.com</link>
	<description>webdevelopment, cms, php, javascript etc</description>
	<lastBuildDate>Sat, 04 Sep 2010 22:55:27 +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>TemplaVoila with default elements</title>
		<link>http://huuah.com/templavoila-with-default-elements/</link>
		<comments>http://huuah.com/templavoila-with-default-elements/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 20:19:43 +0000</pubDate>
		<dc:creator>js - huuah</dc:creator>
				<category><![CDATA[TYPO3]]></category>
		<category><![CDATA[TemplaVoila]]></category>

		<guid isPermaLink="false">http://huuah.com/?p=105</guid>
		<description><![CDATA[<p>There it was. A very basic TemplaVoila setup with two content elements. A <em>content</em> and a <em>rightbar</em>. The <em>content</em> is of course for all the regular stuff on the page, and the <em>right bar</em> has some standard highlights.</p>
<p>When both the <em>content</em> and the <em>rightbar</em> is of the type <em>Content</em>&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>There it was. A very basic TemplaVoila setup with two content elements. A <em>content</em> and a <em>rightbar</em>. The <em>content</em> is of course for all the regular stuff on the page, and the <em>right bar</em> has some standard highlights.</p>
<p>When both the <em>content</em> and the <em>rightbar</em> is of the type <em>Content Elements</em>, you have to manually insert elements on every single page, that should have output. </p>
<p>Wouldn&#8217;t it be nice, if the <em>rightbar</em> could have some default Content Elements outputted automatically, if you haven&#8217;t inserted any elements? Yes, it would!</p>
<p>So. To the fun part. Open your TemplaVoila section in the TYPO3 backend and edit the Data Structure (DS) for the template. The textfield <strong>Data Structure XML</strong> has a lot of XML-data and you should scroll down until you find the section of your element. In my case the element is named field_right and I should then find something like this:</p>
<pre class="brush: plain;">
...
        &lt;field_right type=&quot;array&quot;&gt;
				&lt;tx_templavoila type=&quot;array&quot;&gt;
					&lt;title&gt;&lt;/title&gt;
					&lt;sample_data type=&quot;array&quot;&gt;
						&lt;numIndex index=&quot;0&quot;&gt;&lt;/numIndex&gt;
					&lt;/sample_data&gt;
					&lt;eType&gt;ce&lt;/eType&gt;
					&lt;TypoScript&gt;&lt;![CDATA[
	10= RECORDS
	10.source.current=1
	10.tables = tt_content
	10.wrap = &lt;!--TYPO3SEARCH_begin--&gt; | &lt;!--TYPO3SEARCH_end--&gt;
                    ]]&gt;&lt;/TypoScript&gt;
...
</pre>
<p>We are then going to edit the &lt;TypoScript&gt;-section, so it should look like this:</p>
<pre class="brush: plain; highlight: [14,15,16,17,18,19,20,21,22,23];">
...
        &lt;field_right type=&quot;array&quot;&gt;
				&lt;tx_templavoila type=&quot;array&quot;&gt;
					&lt;title&gt;&lt;/title&gt;
					&lt;sample_data type=&quot;array&quot;&gt;
						&lt;numIndex index=&quot;0&quot;&gt;&lt;/numIndex&gt;
					&lt;/sample_data&gt;
					&lt;eType&gt;ce&lt;/eType&gt;
					&lt;TypoScript&gt;&lt;![CDATA[
	10= RECORDS
	10.source.current=1
	10.tables = tt_content
	10.wrap = &lt;!--TYPO3SEARCH_begin--&gt; | &lt;!--TYPO3SEARCH_end--&gt;
	20 = COA
	20 {
		10 = RECORDS
		10.tables = tt_content
		10.source = 57
		if {
			value.current = 1
			equals =
		}
	}
                    ]]&gt;&lt;/TypoScript&gt;
...
</pre>
<p>This will insert an extra set of data. The COA-element is a container used only for checking if there is any content. Inside the <strong>20</strong> we will insert the content of the <strong>tt_content-element</strong> with the <strong>uid 57</strong>, if the <strong>current value</strong> is nonexisting.</p>
<p>The uid should be changed to the uid of your choice and it is even possible to insert a comma separated list of multiple uids.</p>
<p>The result should now be, that the content of uid 57 will be shown on every page, if the page does not have any elements add to the field_right section in TemplaVoila.</p>
<p>There you go. A TemplaVoila setup with some default output.</p>
<p><span class="warning">*IMPORTANT* when making updates to the TemplaVoila configuration (mappings etc.) the above changes WILL BE overwriting.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://huuah.com/templavoila-with-default-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
