<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>chirale &#187; contemplate</title>
	<atom:link href="http://chirale.wordpress.com/tag/contemplate/feed/" rel="self" type="application/rss+xml" />
	<link>http://chirale.wordpress.com</link>
	<description>watashi no yume...</description>
	<lastBuildDate>Mon, 07 Dec 2009 08:58:07 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='chirale.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/913d290334c442dca8a7360d648ac1bd?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>chirale &#187; contemplate</title>
		<link>http://chirale.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://chirale.wordpress.com/osd.xml" title="chirale" />
		<item>
		<title>PDF cover thumbnails for attached files</title>
		<link>http://chirale.wordpress.com/2008/06/06/pdf-cover-thumbnails-for-attached-files/</link>
		<comments>http://chirale.wordpress.com/2008/06/06/pdf-cover-thumbnails-for-attached-files/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 15:08:36 +0000</pubDate>
		<dc:creator>chirale</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[contemplate]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[ghostscript]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[preview]]></category>
		<category><![CDATA[thumb]]></category>
		<category><![CDATA[thumbnail]]></category>

		<guid isPermaLink="false">http://chirale.wordpress.com/?p=71</guid>
		<description><![CDATA[Tested on:

Drupal 5.x
Content Templates module
ImageMagick 6.3.7
GhostScript 8.15.3

Using ImageMagick + GhostScript you can convert the first page of a PDF into a thumbnail image linking to file. You can cut and paste this function on your theme main script: you have to manually create the thumb directory and grant write permission by scripts. Check also the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chirale.wordpress.com&blog=1488255&post=71&subd=chirale&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Tested on:</p>
<ul>
<li>Drupal 5.x</li>
<li>Content Templates module</li>
<li>ImageMagick 6.3.7</li>
<li>GhostScript 8.15.3</li>
</ul>
<p>Using ImageMagick + GhostScript you can convert the first page of a PDF into a thumbnail image linking to file. You can cut and paste this function on your theme main script: you have to manually create the thumb directory and grant write permission by scripts. Check also the path to ImageMagick convert command.</p>
<pre style="font-size:11px;"><code>
function pdf_thumb_attachments(){
 $allowed_mime = array("application/pdf");
	foreach($files as $file){
	if(in_array(strtolower($file-&gt;filemime),$allowed_mime) &amp;&amp; strstr(strtolower($file-&gt;description),"classifica")){
		$title = $file-&gt;description;
		if(substr($title,-4)==".pdf"){
			# create link title from file name (Transliteration module suggested)
			$title = str_replace("_"," ",substr($title,0,strlen($title)-4));
		}
		$img = "";
		$local_src_path = getcwd() . "/" . $file-&gt;filepath;
		$destfilename = substr($file-&gt;filename,0,strlen($file-&gt;filename)-4) . ".gif";
		# YOUR-FILES-DIRECTORY/pdfgen will hosts the generated thumbnails
		$local_dest_path = getcwd() . "/" . file_directory_path() . "/pdfgen/" . $destfilename;
		$imageurl = base_path() . file_directory_path() . "/pdfgen/" . $destfilename;
		/* create thumbnail on node reading if file doesn't exist */
		if(!file_exists($local_dest_path)){
			# choose the first page of the PDF, scale to 90x90px and convert to GIF
			$exec = '/usr/bin/convert -scale 90x90 "'.$local_src_path.'"[0] "'.$local_dest_path . '"';
			shell_exec($exec);
			/* delete this line if you cannot read the generated file
			$exec = "chmod 777 ".$local_src_path;
			shell_exec($exec);
			//*/
		}
		$img = '&lt;img src="'.$imageurl.'" alt="'.$title.'" /&gt;';
		$output .= "&lt;li&gt;". l($img." ".$title,$file-&gt;filepath, $attributes = array("title"=&gt;$title), $query = NULL, $fragment = NULL, $absolute = TRUE, $html = TRUE) . "&lt;/li&gt;";
	}
	}
 if(!empty($output)){
	$output = '&lt;div class="my-attachments"&gt;&lt;ul&gt;' . $output . "&lt;/ul&gt;&lt;/div&gt;";
 }
 return $output;
}

</code></pre>
<h3>Update</h3>
<p>You can alternatively use imagemagick function provided by image.module (the image.imagemagick.inc file on drupal/includes):</p>
<pre><code>
function file_preview_path($filename, $filepath = 'filepreview') {
  /** generate jpg thumbnails **/
  return $filepath . "/" . substr($filename,0,strlen($filename)-4) . ".jpg";
}

 function file_preview(&amp;$file, $pages = Array(1)) {
   $allowed_mime = array("application/pdf");
   if(in_array(strtolower($file-&gt;filemime),$allowed_mime)){
	$local_src_path = getcwd() . "/" . $file-&gt;filepath;
	$local_dest_path = getcwd() . "/" . file_directory_path() . "/" . file_preview_path($file-&gt;filename);
	# create thumbnail only when needed
	$imagemagick = getcwd() . '/includes/' . 'image.imagemagick.inc';
	if(!file_exists($local_dest_path) &amp;&amp; file_exists($imagemagick)){
		include_once($imagemagick);
               _image_imagemagick_convert($local_src_path.'[0]',
                                                       $local_dest_path, array('-colorspace RGB'));
		# all can read thumbnail files
		if(file_exists($local_dest_path))
			chmod($local_dest_path, 0777);
	}
	return file_preview_path($file-&gt;filename);
    }
    else{
	return FALSE;
    }
 }</code></pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/chirale.wordpress.com/71/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/chirale.wordpress.com/71/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chirale.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chirale.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chirale.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chirale.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chirale.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chirale.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chirale.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chirale.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chirale.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chirale.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chirale.wordpress.com&blog=1488255&post=71&subd=chirale&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chirale.wordpress.com/2008/06/06/pdf-cover-thumbnails-for-attached-files/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12a67456dc1db7deec545e23d51e0c8c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chirale</media:title>
		</media:content>
	</item>
		<item>
		<title>Make JCarousel and Contemplate work together</title>
		<link>http://chirale.wordpress.com/2008/01/13/make-jcarousel-and-contemplate-work-together/</link>
		<comments>http://chirale.wordpress.com/2008/01/13/make-jcarousel-and-contemplate-work-together/#comments</comments>
		<pubDate>Sun, 13 Jan 2008 09:12:47 +0000</pubDate>
		<dc:creator>chirale</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[contemplate]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jcarousel]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://chirale.wordpress.com/2008/01/13/make-jcarousel-and-contemplate-work-together/</guid>
		<description><![CDATA[Drupal modules needed:

JQuery Update*
JCarousel* (read JCarousel documentation)
Contemplate
Image Cache (optional, for thumb rendering)
Lightbox v2 (optional, for thumb zoom to original image)

* = tested on latest official release
Howto subject: How to use JCarousel within a Contemplate modified node body
JCarousel is a nice JQuery plugin to render a vertical or horizontal bar containing some custom HTML code elements. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chirale.wordpress.com&blog=1488255&post=35&subd=chirale&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Drupal modules needed:</p>
<ul>
<li><a href="http://drupal.org/project/jquery_update" target="_blank">JQuery Update</a>*</li>
<li><a href="http://drupal.org/project/jcarousel">JCarousel</a>* (<a href="http://sorgalla.com/projects/jcarousel/">read JCarousel documentation</a>)</li>
<li><a href="http://drupal.org/project/contemplate" target="_blank">Contemplate</a></li>
<li><a href="http://drupal.org/project/imagecache" target="_blank">Image Cache</a> (optional, for thumb rendering)</li>
<li><a href="http://drupal.org/project/lightbox2" target="_blank">Lightbox v2</a> (optional, for thumb zoom to original image)</li>
</ul>
<p>* = <em>tested on latest official release</em><br />
Howto subject: <strong>How to use JCarousel within a Contemplate modified node body</strong></p>
<p>JCarousel is a nice JQuery plugin to render a vertical or horizontal bar containing some custom HTML code elements. Every element is within a list item of an unordered list. On page load a JQuery event trigger the simple unordered list to show as a bar.</p>
<h3>Let&#8217;s start</h3>
<p>To use Contemplate more smoothly (and without cut/paste from your preferred code editor, i.e. <a href="http://quanta.kdewebdev.org/" target="_blank">Quanta</a>), you can create a file-based contemplate instead a database based.</p>
<ol>
<li>Create a <strong>sites/all/contemplates</strong> folder (or sites/mysitename/contemplates)</li>
<li>According to Contemplate help (admin/help/contemplate), put there your <strong>node-mynodetype-body.tpl.php</strong> file, where &#8220;mynodetype&#8221; is the machine name of the type you want to modify (that one that appears like node/add/mynodetype when you create a new node of that type).</li>
<li>Visit <strong>admin/content/templates</strong> to update the contemplate list. Now, if you go to <strong>admin/content/templates/mynodetype</strong> you can read:<br />
<blockquote><p>This template is being read fromsites/all/contemplates/node-mynodetype-body.tpl.php<br />
Please make changes to this file or remove it to continue editing here.</p></blockquote>
</li>
</ol>
<p>This is your contemplate file for this how-to. You&#8217;ve only to modify it, upload it and watch your <strong>mynodetype</strong> body growing up with JCarousel.</p>
<h3>Call JCarousel</h3>
<p>On the top of your content template, write:</p>
<blockquote><p>if(module_exists(&#8220;jcarousel&#8221;)){<br />
jcarousel_add(&#8220;tango&#8221;);<br />
$js = &#8220;// &lt;![CDATA[<br />
#function to add a Bouncing Effect on your JCarousel: you can add another custom effect function<br />
// Credits: Robert Penners easing equations (http://www.robertpenner.com/easing/).<br />
jQuery.easing['BounceEaseOut'] = function(p, t, b, c, d) {<br />
if ((t/=d) &lt; (1/2.75)) {<br />
return c*(7.5625*t*t) + b;<br />
} else if (t &lt; (2/2.75)) {<br />
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;<br />
} else if (t &lt; (2.5/2.75)) {<br />
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;<br />
} else {<br />
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;<br />
}<br />
};</p>
<p># Call JCarousel when page is ready for the element mycarousel<br />
# Read http://sorgalla.com/projects/jcarousel/#Configuration<br />
jQuery(document).ready(function() {<br />
jQuery(&#8216;#mycarousel&#8217;).jcarousel({<br />
vertical: false,<br />
animation: 3000,<br />
easing: &#8216;BounceEaseOut&#8217;,<br />
visible: 5,<br />
scroll: 4<br />
});<br />
});<br />
// ]]&gt;&#8221;;</p>
<p>#add to HTML page HEAD this JavaScript code<br />
drupal_add_js($js, &#8216;inline&#8217;, &#8216;header&#8217;);<br />
}<br />
?&gt;</p></blockquote>
<h3>Styling</h3>
<p>Using latest official release of JCarousel, tango theme skin.css file returns a buggy appearance. You can switch to the <a href="http://sorgalla.com/projects/jcarousel/skins/tango/skin.css" target="_blank">original tango skin.css file on sorgalla.com</a>. Simply copy that file to your module skin folder.<br />
In order to make your JCarousel works better, you have to write some additional CSS lines on your theme CSS file:</p>
<blockquote><p>/* JCarousel custom CSS for horizontal bars */<br />
/* DO NOT USE margin or padding for item elements<br />
(auto-adjusted with visible/scroll JCarousel options) */<br />
.jcarousel-item-horizontal{<br />
width: 100px;<br />
}<br />
/* Bar total width for 5 elements<br />
(100&#215;5)px + 10px horizontal padding */<br />
.jcarousel-container-horizontal,<br />
.jcarousel-clip-horizontal{<br />
width: 550px;<br />
}</p>
<p>/* center jcarousel within a block element */<br />
..jcarousel-container-horizontal{<br />
margin: auto;<br />
}</p>
<p>/* item height = bar height */<br />
.char .jcarousel-item-horizontal,<br />
.char .jcarousel-clip-horizontal{<br />
height: 150px;<br />
}</p></blockquote>
<h3>Contemplate JCarousel</h3>
<p>A simple but useful way to test JCarousel is to display attached image files on your <strong>mynodetype</strong>. Assuming that all attached files are image files, that you want tango theme and you want to render an imagecache picture with preset named &#8220;my_thumbnail_preset&#8221;, add to your contemplate file these lines:</p>
<blockquote><p>&lt;?php<br />
/* UPLOADED FILE CAROUSEL */<br />
$attached_files_carousel = TRUE;</p>
<p>if($attached_files_carousel): ?&gt;<br />
&lt;ul id=&#8221;mycarousel&#8221; class=&#8221;jcarousel-skin-tango&#8221;&gt;<br />
&lt;?php<br />
$preview_imagecache_preset = &#8216;character_picture&#8217;;<br />
if(!empty($node-&gt;files)){<br />
foreach($node-&gt;files as $uploaded_file){<br />
/* if imagecache is present, build the thumbnail */<br />
if(module_exists(&#8216;imagecache&#8217;))<br />
$uploaded_file_preview = theme(&#8216;imagecache&#8217;,$preview_imagecache_preset,$uploaded_file-&gt;filepath);<br />
else<br />
$uploaded_file_preview = l($uploaded_file-&gt;filename,$uploaded_file-&gt;filepath);<br />
/* Print the List Item */<br />
print &#8220;&lt;li&gt;&#8221; . &#8216;&lt;a title=&#8221;&#8216;.$uploaded_file-&gt;filename.&#8217;&#8221; rel=&#8221;lightbox&#8221; href=&#8221;&#8216;. base_path() . $uploaded_file-&gt;filepath . &#8216;&#8221;&gt;&#8217;.  $uploaded_file_preview . &#8216;&lt;/a&gt;&#8217; . &#8220;&lt;/li&gt;&#8221;;<br />
}<br />
}<br />
?&gt;<br />
&lt;/ul&gt;<br />
&lt;?php # END CAROUSEL<br />
endif; ?&gt;</p></blockquote>
<p><a title="Fantastic Attachments" rel="attachment wp-att-36" href="http://chirale.wordpress.com/2008/01/13/make-jcarousel-and-contemplate-work-together/fantastic-attachments/"><img src="http://chirale.files.wordpress.com/2008/01/fantastic-attachments.jpg" alt="Fantastic Attachments" /></a></p>
<p>This method simply write the <strong>UL#mycarousel</strong> via PHP (static JCarousel method). Using <strong>rel=&#8221;lightbox&#8221;</strong> enable image file zoom via JavaScript, if <a href="http://drupal.org/project/lightbox2" target="_blank">lightbox v2 module</a> is enabled. If you want to implement complex AJAX loading or to experiment more JCarousel effects, options and customizations, see also:</p>
<ul>
<li><a href="http://sorgalla.com/projects/jcarousel" target="_blank">JCarousel documentation</a></li>
<li><a href="http://sorgalla.com/jcarousel" target="_blank">JCarousel examples</a></li>
</ul>
<p>Another example, using some CSS and <a href="http://drupal.org/project/photoframe" target="_blank">photoframe</a> module:</p>
<p><a href="http://chirale.files.wordpress.com/2008/10/animemex_prototype_jcarousel_1225015884165.jpg"><img class="alignnone size-medium wp-image-199" title="animemex_prototype_jcarousel_1225015884165" src="http://chirale.files.wordpress.com/2008/10/animemex_prototype_jcarousel_1225015884165.jpg?w=300" alt="" width="300" height="87" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/chirale.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/chirale.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chirale.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chirale.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chirale.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chirale.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chirale.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chirale.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chirale.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chirale.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chirale.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chirale.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chirale.wordpress.com&blog=1488255&post=35&subd=chirale&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chirale.wordpress.com/2008/01/13/make-jcarousel-and-contemplate-work-together/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12a67456dc1db7deec545e23d51e0c8c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chirale</media:title>
		</media:content>

		<media:content url="http://chirale.files.wordpress.com/2008/01/fantastic-attachments.jpg" medium="image">
			<media:title type="html">Fantastic Attachments</media:title>
		</media:content>

		<media:content url="http://chirale.files.wordpress.com/2008/10/animemex_prototype_jcarousel_1225015884165.jpg?w=300" medium="image">
			<media:title type="html">animemex_prototype_jcarousel_1225015884165</media:title>
		</media:content>
	</item>
		<item>
		<title>collapsible content using contemplate</title>
		<link>http://chirale.wordpress.com/2007/12/19/collapsible-content-using-contemplate/</link>
		<comments>http://chirale.wordpress.com/2007/12/19/collapsible-content-using-contemplate/#comments</comments>
		<pubDate>Wed, 19 Dec 2007 19:53:45 +0000</pubDate>
		<dc:creator>chirale</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[contemplate]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://chirale.wordpress.com/2007/12/19/collapsible-content-using-contemplate/</guid>
		<description><![CDATA[How to make a collapsible content body with Contemplate and the Drupal core &#8220;collapsible&#8221; function?

Make sure you&#8217;ve Contemplate enabled (through admin/build/modules)
Go to admin/content/templates and choose the type you want to display collapsible content within.
Enable body contemplate checking &#8220;Affect body output&#8221; and write (change field names):
&#60;?php
drupal_add_js(&#8216;misc/collapse.js&#8217;);
drupal_add_js(&#8216;misc/drupal.js&#8217;);
?&#62;
&#60;fieldset class=&#8221;collapsible collapsed&#8221;&#62;
&#60;legend&#62;&#60;?php print t(&#8220;My Translatable First Field Label&#8221;)?&#62;&#60;/legend&#62;
&#60;div class=&#8221;fieldset-wrapper&#8221;&#62;
&#60;h2&#62;&#60;?php print [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chirale.wordpress.com&blog=1488255&post=28&subd=chirale&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>How to make a collapsible content body with <a href="http://drupal.org/project/contemplate">Contemplate</a> and the Drupal core &#8220;collapsible&#8221; function?</p>
<ol>
<li>Make sure you&#8217;ve Contemplate enabled (through admin/build/modules)</li>
<li>Go to <code>admin/content/templates</code> and choose the type you want to display collapsible content within.</li>
<li>Enable body contemplate checking &#8220;Affect body output&#8221; and write (change field names):<br />
<blockquote><p>&lt;?php<br />
drupal_add_js(&#8216;misc/collapse.js&#8217;);<br />
drupal_add_js(&#8216;misc/drupal.js&#8217;);<br />
?&gt;<br />
&lt;fieldset class=&#8221;collapsible collapsed&#8221;&gt;<br />
&lt;legend&gt;&lt;?php print t(&#8220;My Translatable First Field Label&#8221;)?&gt;&lt;/legend&gt;<br />
&lt;div class=&#8221;fieldset-wrapper&#8221;&gt;<br />
&lt;h2&gt;&lt;?php print t(&#8220;My Translatable First Field Header&#8221;)?&gt;&lt;/h2&gt;<br />
&lt;?php print $node-&gt;field_myfirstfield[0]['view'] ?&gt;<br />
&lt;/div&gt;<br />
&lt;/fieldset&gt;</p></blockquote>
<blockquote><p>&lt;div class=&#8221;mysecondfield&#8221;&gt;<br />
&lt;?php print $node-&gt;field_mysecondfield[0]['view'] ?&gt;<br />
&lt;/div&gt;</p></blockquote>
</li>
</ol>
<p><b>Update:</b> If you want a collapsible box expanded by default, use <b>class=&#8221;collapsible&#8221;</b> without &#8220;collapsed&#8221; class.</p>
<p>See also:<br />
<a href="http://www.codesnippet.info/?p=52">Add collapsible content in Drupal @ Random Snippets</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/chirale.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/chirale.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chirale.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chirale.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chirale.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chirale.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chirale.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chirale.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chirale.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chirale.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chirale.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chirale.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chirale.wordpress.com&blog=1488255&post=28&subd=chirale&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chirale.wordpress.com/2007/12/19/collapsible-content-using-contemplate/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12a67456dc1db7deec545e23d51e0c8c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chirale</media:title>
		</media:content>
	</item>
	</channel>
</rss>