<?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>CodeBlog.ch &#187; PHP</title>
	<atom:link href="http://www.codeblog.ch/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codeblog.ch</link>
	<description>Coding and more - Concrete5, Flex, JavaScript</description>
	<lastBuildDate>Fri, 18 Jun 2010 08:05:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Concrete5 &#8211; Using TinyMCE Templates</title>
		<link>http://www.codeblog.ch/2010/06/concrete5-using-tinymce-templates/</link>
		<comments>http://www.codeblog.ch/2010/06/concrete5-using-tinymce-templates/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 08:05:06 +0000</pubDate>
		<dc:creator>Remo Laubacher</dc:creator>
				<category><![CDATA[Concrete5]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.codeblog.ch/?p=449</guid>
		<description><![CDATA[The Concrete5 content block uses TinyMCE as its WYSIWYG editor. Thanks to this decision, we are able to use several plugins most Concrete5 users haven&#8217;t thought about.
One feature I really like is the &#8220;template&#8221; plugin which allows you to create html snippets which you can insert into the content block. In this tutorial I&#8217;m going [...]]]></description>
			<content:encoded><![CDATA[<p>The Concrete5 content block uses TinyMCE as its WYSIWYG editor. Thanks to this decision, we are able to use several plugins most Concrete5 users haven&#8217;t thought about.</p>
<p>One feature I really like is the &#8220;template&#8221; plugin which allows you to create html snippets which you can insert into the content block. In this tutorial I&#8217;m going to show you, how you can create a simple 2 and 3 column table template.</p>
<h2>TinyMCE Configuration</h2>
<p>You&#8217;ll find almost anything you have to know on this page: <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template">http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template</a>. But luckily for you, I&#8217;m going to make this even easier for you.</p>
<p>First, you have to go to the Dashboard &#8211; Sitewide Settings. In the bottom right corner, you can activate a &#8220;Custom&#8221; configuration for the rich text editor. Once you&#8217;ve enabled it, it will show you some options. What do we need to activate the TinyMCE templates:</p>
<ul>
<li>We have to load the template plugin</li>
<li>There must be a button to display the template dialog</li>
<li>We have to create at least one template</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">theme <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;concrete&quot;</span><span style="color: #339933;">,</span> 
plugins<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;inlinepopups,spellchecker,safari,advlink,template&quot;</span><span style="color: #339933;">,</span>
editor_selector <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;ccm-advanced-editor&quot;</span><span style="color: #339933;">,</span>
spellchecker_languages <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;+English=en&quot;</span><span style="color: #339933;">,</span>	
theme_concrete_buttons1 <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;template,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,hr,|,styleselect,formatselect,fontsizeselect&quot;</span><span style="color: #339933;">,</span>
theme_concrete_buttons2 <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,forecolor&quot;</span><span style="color: #339933;">,</span>
theme_concrete_blockformats <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;p,address,pre,h1,h2,h3,div,blockquote,cite&quot;</span><span style="color: #339933;">,</span>
theme_concrete_toolbar_align <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;left&quot;</span><span style="color: #339933;">,</span>
theme_concrete_fonts <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats&quot;</span><span style="color: #339933;">,</span>
theme_concrete_font_sizes <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1,2,3,4,5,6,7&quot;</span><span style="color: #339933;">,</span>
theme_concrete_styles<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Note=ccm-note&quot;</span><span style="color: #339933;">,</span>
spellchecker_languages <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;+English=en&quot;</span><span style="color: #339933;">,</span>
template_templates <span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
	<span style="color: #009900;">&#123;</span>
		title <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;2 Columns&quot;</span><span style="color: #339933;">,</span>
		src <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;themes/yourTheme/templates/2_columns.html&quot;</span><span style="color: #339933;">,</span>
		description <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Adds a 2 columns table&quot;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	<span style="color: #009900;">&#123;</span>
		title <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;3 Columns&quot;</span><span style="color: #339933;">,</span>
		src <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;themes/yourTheme/templates/3_columns.html&quot;</span><span style="color: #339933;">,</span>
		description <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Adds a 3 columns table&quot;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#93;</span></pre></div></div>

<p>There&#8217;s one thing you probably have to change. In the two templates I&#8217;ve added, there&#8217;s a hardcoded path which won&#8217;t work on your site. Make sure it points to an existing directory. The content of the html file is rather simple. I modified the example for TinyMCE to make it look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xhtml" style="font-family:monospace;">&lt;!-- This will not be inserted --&gt;
&lt;div class=&quot;mceTmpl&quot;&gt;
&lt;table width=&quot;98%&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
&lt;tr&gt;
&lt;th scope=&quot;col&quot;&gt;HEADER 1&lt;/th&gt;
&lt;th scope=&quot;col&quot;&gt;HEADER 2&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sample Data&lt;/td&gt;
&lt;td&gt;Sample Data&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;</pre></div></div>

<h2>How you can insert an HTML snippet</h2>
<p>You&#8217;re already done, but where can you find the snippets? We you add a new content block, you&#8217;ll see a new button:<br />
<img src="http://www.codeblog.ch/wp-content/uploads/2010/06/template-button-492x400.png" alt="" title="template-button" width="492" height="400" class="alignnone size-medium wp-image-451" /></p>
<p>When you click on this button, you&#8217;ll see a dialog where you can select the template:</p>
<p><img src="http://www.codeblog.ch/wp-content/uploads/2010/06/templates-471x400.png" alt="" title="templates" width="471" height="400" class="alignnone size-medium wp-image-452" /></p>
<p>Unfortunately, the insert button is a bit hidden, you have to scroll down to insert the template. You can insert as many snippets into one content block as you want:</p>
<p><img src="http://www.codeblog.ch/wp-content/uploads/2010/06/content-block-489x400.png" alt="" title="content-block" width="489" height="400" class="alignnone size-medium wp-image-453" /></p>
<p>I hope you like it and thanks for completely reading this tutorial! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.codeblog.ch/2010/06/concrete5-using-tinymce-templates/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Concrete5 &#8211; Custom 404 page</title>
		<link>http://www.codeblog.ch/2010/01/concrete5-custom-404-page/</link>
		<comments>http://www.codeblog.ch/2010/01/concrete5-custom-404-page/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 11:32:55 +0000</pubDate>
		<dc:creator>Remo Laubacher</dc:creator>
				<category><![CDATA[Concrete5]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.codeblog.ch/?p=425</guid>
		<description><![CDATA[It hopefullly doesn&#8217;t happen very often but sometimes a user might enter an address which doesn&#8217;t exist. In most situations a simple page is displayed, telling him that the page doesn&#8217;t exist. Having some more detailled information can be very helpful, especially when you just relaunched your website. Google &#038; Co need a while to [...]]]></description>
			<content:encoded><![CDATA[<p>It hopefullly doesn&#8217;t happen very often but sometimes a user might enter an address which doesn&#8217;t exist. In most situations a simple page is displayed, telling him that the page doesn&#8217;t exist. Having some more detailled information can be very helpful, especially when you just relaunched your website. Google &#038; Co need a while to reindex your page and users will probably see &#8220;page not found&#8221; more frequently than usually.</p>
<p>Concrete5 allows you to customize this page but it needs a few modifications. Some of them are probably a bit hard to find &#8211; which is why I wrote this tutorial. The standard Concrete5 &#8220;page not found&#8221; page looks like this:</p>
<p><a href="http://www.codeblog.ch/wp-content/uploads/2010/01/pagenotfound.png"><img src="http://www.codeblog.ch/wp-content/uploads/2010/01/pagenotfound-300x194.png" alt="pagenotfound" title="pagenotfound" width="300" height="194" class="alignnone size-medium wp-image-426" /></a> </p>
<p><span id="more-425"></span></p>
<p>As you can see, the layout uses the default concrete5 dashboard theme. First, we&#8217;d like to use our own theme! Open &#8220;config/site_theme_paths.php&#8221;, there are already a few commented examples in the file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>  
&nbsp;
<span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'C5_EXECUTE'</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span>_<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Access Denied.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$v</span> <span style="color: #339933;">=</span> View<span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$v</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setThemeByPath</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/page_not_found'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;yourtheme&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* 
	you can override system layouts here  - but we're not going to by default 
&nbsp;
	For example: if you would like to theme your login page with the Green Salad theme,
	you would uncomment the lines below and change the second argument of setThemeByPath 
	to be the handle of the the Green Salad theme &quot;greensalad&quot; 
&nbsp;
$v = View::getInstance();
&nbsp;
$v-&gt;setThemeByPath('/login', &quot;yourtheme&quot;);
 // $v-&gt;setThemeByPath('/403', &quot;yourtheme&quot;);
 // $v-&gt;setThemeByPath('/register', &quot;yourtheme&quot;);
 // $v-&gt;setThemeByPath('/dashboard', &quot;yourtheme&quot;);
&nbsp;
*/</span></pre></td></tr></table></div>

<p>In line 5 and 6 you can see the two lines I&#8217;ve added. Make sure that you replace &#8220;yourtheme&#8221; with the name of your theme &#8211; identical to the directory name of your theme in the folder &#8220;themes&#8221;.</p>
<p>Make sure your theme has a file called view.php. It might look similar to this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'C5_EXECUTE'</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span>_<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Access Denied.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">inc</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'elements/header.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
 	&lt;div id=&quot;content&quot;&gt;
	   &lt;div id=&quot;body&quot;&gt;
	   	&lt;!-- begin --&gt;
	   	<span style="color: #000000; font-weight: bold;">&lt;?php</span>
	   	<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$innerContent</span><span style="color: #339933;">;</span>
	   	<span style="color: #000000; font-weight: bold;">?&gt;</span>
	   	&lt;!-- end --&gt;
	   &lt;/div&gt;
	&lt;/div&gt;	
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">inc</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'elements/footer.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>$innerContent is where all the information is saved. </p>
<p>Once you&#8217;ve saved site_theme_paths.php your error page uses your own theme. In my case like this:</p>
<p><a href="http://www.codeblog.ch/wp-content/uploads/2010/01/pagenotfound-custom.png"><img src="http://www.codeblog.ch/wp-content/uploads/2010/01/pagenotfound-custom-300x205.png" alt="pagenotfound-custom" title="pagenotfound-custom" width="300" height="205" class="alignnone size-medium wp-image-429" /></a></p>
<h2>Sitemap</h2>
<p>It might make sense to display a sitemap when a users landed on the 404 page. This is also easy to do. Create a copy of /concrete/single_pages/page_not_found.php here /single_pages/page_not_found.php. This makes sure we don&#8217;t modify files within the Concrete5 core. Open the file and make it look like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'C5_EXECUTE'</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span>_<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Access Denied.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;h1 class=&quot;error&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Page Not Found'</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h1&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'No page could be found at this address.'</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;br/&gt;&lt;br/&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Area<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Main&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">display</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;br/&gt;&lt;br/&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$bt</span> <span style="color: #339933;">=</span> BlockType<span style="color: #339933;">::</span><span style="color: #004000;">getByHandle</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'autonav'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$bt</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">controller</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">orderBy</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'display_asc'</span><span style="color: #339933;">;</span>                    
<span style="color: #000088;">$bt</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">controller</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">displayPages</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'top'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$bt</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">controller</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">displaySubPages</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'all'</span><span style="color: #339933;">;</span>     
<span style="color: #000088;">$bt</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">controller</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">displaySubPageLevels</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'all'</span><span style="color: #339933;">;</span>                    
<span style="color: #000088;">$bt</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">render</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>		
&nbsp;
&lt;br/&gt;&lt;br/&gt;
&nbsp;
&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> DIR_REL<span style="color: #000000; font-weight: bold;">?&gt;</span>/&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Back to Home'</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;.</pre></td></tr></table></div>

<p>Lines 13 to 20 uses the autonav block to display a sitemap. That&#8217;s it! In my case the &#8220;page not found&#8221; page looks like this:<br />
<a href="http://www.codeblog.ch/wp-content/uploads/2010/01/pagenotfound-sitemap.png"><img src="http://www.codeblog.ch/wp-content/uploads/2010/01/pagenotfound-sitemap-300x203.png" alt="pagenotfound-sitemap" title="pagenotfound-sitemap" width="300" height="203" class="alignnone size-medium wp-image-432" /></a></p>
<p>A bit useless in my case but probably more helpful if you have more pages than I do.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codeblog.ch/2010/01/concrete5-custom-404-page/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Image Navigation Items</title>
		<link>http://www.codeblog.ch/2009/12/image-navigation-items/</link>
		<comments>http://www.codeblog.ch/2009/12/image-navigation-items/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 09:01:59 +0000</pubDate>
		<dc:creator>Remo Laubacher</dc:creator>
				<category><![CDATA[Concrete5]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Autonav]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.codeblog.ch/?p=405</guid>
		<description><![CDATA[It&#8217;s been a while since I&#8217;ve posted the last tutorial. Due to some unexpected events I finally found some time to write a new one.
The default autonav Block in Concrete5 allows you to add a navigation/menu to your site in almost no time. But as soon as you want to use images it get a [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I&#8217;ve posted the last tutorial. Due to some unexpected events I finally found some time to write a new one.</p>
<p>The default autonav Block in Concrete5 allows you to add a navigation/menu to your site in almost no time. But as soon as you want to use images it get a bit more difficult. In this tutorial I&#8217;m going to show you, how you can specify pictures for each page and pull them in an autonav template.</p>
<p><span id="more-405"></span></p>
<h2>Page attributes</h2>
<p>Concrete5 allows you do add different kinds of attributes to your page. You can use them to manage meta tags, tags, notes, thumbnails or images for your navigation. First we have to create two new page attributes where we can select the pictures. One which will be shown if the page is currently active and one for inactive pages.</p>
<p><a href="http://www.codeblog.ch/wp-content/uploads/2009/12/1_page_attribute.png"><img src="http://www.codeblog.ch/wp-content/uploads/2009/12/1_page_attribute-300x174.png" alt="1_page_attribute" title="1_page_attribute" width="300" height="174" class="alignnone size-medium wp-image-406" /></a></p>
<p>All the important information has a red overlay:</p>
<ul>
<li>Attribute type must be Image/File</li>
<li>The Handle is used in the template, make sure you remember it</li>
<li>The Name is just a description to explain what the use of the attribute is</li>
</ul>
<h2>Assign images</h2>
<p>We have two new attributes where we can assign some images. The following screenshot explains this:</p>
<p><a href="http://www.codeblog.ch/wp-content/uploads/2009/12/2_set_pictures.png"><img src="http://www.codeblog.ch/wp-content/uploads/2009/12/2_set_pictures-300x186.png" alt="2_set_pictures" title="2_set_pictures" width="300" height="186" class="alignnone size-medium wp-image-407" /></a></p>
<ul>
<li>In the sitemap, open &#8220;Properties&#8221; for the page where you would like to see an image in the navigation</li>
<li>Go to the last tab &#8220;Custom Fields&#8221; and add the two fields you just created</li>
<li>Select the image you want to see if the page is active and inactive</li>
</ul>
<p>Do this for all the pages where you&#8217;d like to have an image instead of a text link. You can always add and modify the images for the pages. Even your end-user can add new image menu item this way. One of many reasons why page attributes are so powerful!</p>
<h2>Custom Autonav Template</h2>
<p>If you haven&#8217;t worked with custom template you should probably read this tutorial first: <a href="http://www.codeblog.ch/2009/03/concrete5-templates/">http://www.codeblog.ch/2009/03/concrete5-templates/</a>.</p>
<p>To create a new custom template, simply copy /concrete/blocks/autonav/view.php to /blocks/autonav/templates/image_navigation.php. You probably have to create the folders autonav and templates first.</p>
<p>Around line 55 you should see this code (might be different, depending on your c5 version:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCollectionID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$_c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCollectionID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
	<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'
	&lt;li class=&quot;nav-selected nav-path-selected&quot;&gt;&lt;a class=&quot;nav-selected nav-path-selected&quot; href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$pageLink</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$ni</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCollectionID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$selectedPathCIDs</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
	<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'
	&lt;li class=&quot;nav-path-selected&quot;&gt;&lt;a class=&quot;nav-path-selected&quot; href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$pageLink</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$ni</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'
	&lt;li&gt;&lt;a href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$pageLink</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$ni</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>With some HTML and PHP knowledge you probably have already found the place which outputs the link text. It&#8217;s of course &#8220;$ni->getName()&#8221;. This is the code which we have to modify to display images if they&#8217;ve been selected.</p>
<p>We replace $ni->getName() with variables which will hold the html code for the image or the link text:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$linkTextActive</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$ni</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$linkTextInactive</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$ni</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$picOn</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pic_on'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$picOff</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pic_off'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$picOn</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$linkTextActive</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;img src=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$picOn</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getURL</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; alt=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$linkTextActive</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;/&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$picOff</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$linkTextInactive</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;img src=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$picOff</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getURL</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; alt=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$linkTextInactive</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;/&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCollectionID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$_c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCollectionID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
	<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'
	&lt;li class=&quot;nav-selected nav-path-selected&quot;&gt;&lt;a class=&quot;nav-selected nav-path-selected&quot; href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$pageLink</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$linkTextActive</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCollectionID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$selectedPathCIDs</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
	<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'
	&lt;li class=&quot;nav-path-selected&quot;&gt;&lt;a class=&quot;nav-path-selected&quot; href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$pageLink</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$linkTextActive</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'
	&lt;li&gt;&lt;a href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$pageLink</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$linkTextInactive</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<ul>
<li>Line 1,2: The new variables</li>
<li>Line 4,5: Get the attribute values &#8211; the image</li>
<li>Line 7-12: Checks if the attribute has a value and replaces the link text</li>
</ul>
<p>Now you can add an autonav block, set all the properties and after you&#8217;ve added the block, click on it again an hit &#8220;Set Custom Template&#8221;. If you create our custom template in the correct folder, you should now be able to select it.</p>
<p>If everything worked you should now have a top navigation like this:</p>
<p><a href="http://www.codeblog.ch/wp-content/uploads/2009/12/example.png"><img src="http://www.codeblog.ch/wp-content/uploads/2009/12/example-300x165.png" alt="example" title="example" width="300" height="165" class="alignnone size-medium wp-image-417" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codeblog.ch/2009/12/image-navigation-items/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Concrete5 &#8211; Formular Layout anpassen</title>
		<link>http://www.codeblog.ch/2009/07/concrete5-form-layout/</link>
		<comments>http://www.codeblog.ch/2009/07/concrete5-form-layout/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 11:12:51 +0000</pubDate>
		<dc:creator>Remo Laubacher</dc:creator>
				<category><![CDATA[Concrete5]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.codeblog.ch/?p=368</guid>
		<description><![CDATA[Concrete5 has a nice form block which allows you to create a contact form within a few seconds. You don&#8217;t even need to have any html or php skills to create a simple file upload form. Unfortunately this block isn&#8217;t very easy to style. It uses some html markup which makes it a bit tricky [...]]]></description>
			<content:encoded><![CDATA[<p>Concrete5 has a nice form block which allows you to create a contact form within a few seconds. You don&#8217;t even need to have any html or php skills to create a simple file upload form. Unfortunately this block isn&#8217;t very easy to style. It uses some html markup which makes it a bit tricky to use CSS. However, it doesn&#8217;t mean it&#8217;s impossible! I&#8217;m going to show you how you can easily create a styles form using Concrete5 Custom Templates to produce this:</p>
<p><a href="http://www.codeblog.ch/wp-content/uploads/2009/07/pic2.png"><img src="http://www.codeblog.ch/wp-content/uploads/2009/07/pic2-300x257.png" alt="Styles Form" title="Styles Form" width="300" height="257" class="alignnone size-medium wp-image-370" /></a></p>
<p><span id="more-368"></span></p>
<h2>Custom Templates</h2>
<p>If you don&#8217;t know anything about &#8220;Custom Templates&#8221;, you should probably read this article first: <a href="http://www.codeblog.ch/2009/03/concrete5-templates/">http://www.codeblog.ch/2009/03/concrete5-templates/</a>. In short: Concrete5 allows you to style any block using templates in case you need to change the html output and not only the css rules.</p>
<h2>Core modification</h2>
<p>There&#8217;s one small thing I didn&#8217;t want to modify in the custom template since it shouldn&#8217;t be printed anyways. This might change in a future version, but because it doesn&#8217;t break anything I&#8217;m going to make the &#8220;not recommendable&#8221; core change in this case. Open the file &#8220;concrete/blocks/form/controller.php&#8221; and go to line 667 as shown on this screenshot:</p>
<p><a href="http://www.codeblog.ch/wp-content/uploads/2009/07/pic1.png"><img src="http://www.codeblog.ch/wp-content/uploads/2009/07/pic1-300x46.png" alt="pic1" title="pic1" width="300" height="46" class="alignnone size-medium wp-image-369" /></a></p>
<p>Remove &#8217;style=&#8221;width:95%&#8221;&#8216; as it makes css styling a bit nasty. Please note that this step isn&#8217;t necessary, it&#8217;s just about the layout!</p>
<h2>The default layout</h2>
<p>If you create a new form, it usually looks like this:</p>
<p><a href="http://www.codeblog.ch/wp-content/uploads/2009/07/pic3.png"><img src="http://www.codeblog.ch/wp-content/uploads/2009/07/pic3-300x167.png" alt="pic3" title="pic3" width="300" height="167" class="alignnone size-medium wp-image-371" /></a></p>
<p>It works but doesn&#8217;t look very nice.</p>
<h2>New form style</h2>
<p>In this tutorial I&#8217;m showing you how you can create a form in which the labels are in the textfields and not on top or left. This might especially be useful if you have a very small page and a huge form. It also looks nice. </p>
<p>This is how the result is going to look like:<br />
<a href="http://www.codeblog.ch/wp-content/uploads/2009/07/pic2.png"><img src="http://www.codeblog.ch/wp-content/uploads/2009/07/pic2-300x257.png" alt="Styles Form" title="Styles Form" width="300" height="257" class="alignnone size-medium wp-image-370" /></a></p>
<p>Let me start with the php template view.php:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>    
<span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'C5_EXECUTE'</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span>_<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Access Denied.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$survey</span><span style="color: #339933;">=</span><span style="color: #000088;">$controller</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$miniSurvey</span><span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> MiniSurvey<span style="color: #009900;">&#40;</span><span style="color: #000088;">$b</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$miniSurvey</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">frontEndMode</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div class=&quot;ccm-form&quot; id=&quot;ccm-form-id-<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bID</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$invalidIP</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div class=&quot;ccm-error&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$invalidIP</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;form enctype=&quot;multipart/form-data&quot; id=&quot;miniSurveyView<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bID</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;miniSurveyView&quot; method=&quot;post&quot; action=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">action</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'submit_form'</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span>   <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'surveySuccess'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'qsid'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$survey</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">questionSetId</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div id=&quot;msg&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$survey</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">thankyouMsg</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>   <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$formResponse</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div id=&quot;msg&quot;&gt;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$formResponse</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;?php</span>  
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$errors</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$error</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'
&lt;div class=&quot;error&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$error</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/div&gt;
'</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;input name=&quot;qsID&quot; type=&quot;hidden&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span>  <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$survey</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">questionSetId</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;
	&lt;input name=&quot;pURI&quot; type=&quot;hidden&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span>  <span style="color: #000088;">$pURI</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span>   	
	<span style="color: #000088;">$questionsRS</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$miniSurvey</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadQuestions</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$survey</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">questionSetId</span><span style="color: #339933;">,</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$surveyBlockInfo</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$miniSurvey</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMiniSurveyBlockInfoByQuestionId</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$survey</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">questionSetId</span><span style="color: #339933;">,</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bID</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$showEdit</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$hideQIDs</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$questionRow</span><span style="color: #339933;">=</span><span style="color: #000088;">$questionsRS</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetchRow</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>	
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$questionRow</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'qID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$hideQIDs</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$msqID</span><span style="color: #339933;">=</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$questionRow</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'msqID'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$requiredClass</span><span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$questionRow</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'required'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #0000ff;">' required '</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$requiredSymbol</span><span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$questionRow</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'required'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #0000ff;">' *'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'
&lt;div class=&quot;ccm-form-element'</span><span style="color: #339933;">.</span><span style="color: #000088;">$requiredClass</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Question'</span><span style="color: #339933;">.</span><span style="color: #000088;">$msqID</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$questionRow</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'question'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$requiredSymbol</span><span style="color: #339933;">;</span>				
&nbsp;
		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$miniSurvey</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadInputType</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$questionRow</span><span style="color: #339933;">,</span>showEdit<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/div&gt;
&quot;</span><span style="color: #339933;">;</span>	
	<span style="color: #009900;">&#125;</span>	
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$surveyBlockInfo</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'displayCaptcha'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>		
		<span style="color: #000088;">$captcha</span> <span style="color: #339933;">=</span> Loader<span style="color: #339933;">::</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'validation/captcha'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>				
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;
&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>ccm-form-captcha<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'
&lt;div class=&quot;required&quot;&gt;'</span><span style="color: #339933;">;</span>		
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;input type=&quot;text&quot; value=&quot;Sicherheitscode hier eingeben&quot; name=&quot;ccmCaptchaCode&quot; class=&quot;ccm-input-captcha&quot;/&gt;'</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">// Please note that we need to style our captcha, we therefore create it manually!</span>
		<span style="color: #666666; font-style: italic;">//$captcha-&gt;showInput();</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/div&gt;
&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;
&lt;div&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$captcha</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">display</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/div&gt;
&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/div&gt;
&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'
&lt;div style=&quot;clear:both&quot;&gt;&lt;/div&gt;
'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;input class=&quot;formBlockSubmitButton button&quot; name=&quot;Submit&quot; type=&quot;submit&quot; value=&quot;senden&quot; /&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">?&gt;</span> 
&lt;/form&gt;&lt;/div&gt;</pre></td></tr></table></div>

<p>I&#8217;m not explaing each line because I assume you understand PHP, otherwise this tutorial isn&#8217;t made for you &#8211; sorry!<br />
What I changed:</p>
<ul>
<li>Calling some methods found in the controller out of the view</li>
<li>Created a div layout instead of a table layout</li>
<li>Added some CSS classes to indicate required fields</li>
<li>Added a strange line which makes sure that the value attribute of the textfield contain the description</li>
</ul>
<p>Now, we&#8217;ve got a form where we don&#8217;t have any labels next to the input fields. But we need to get rid of these values at some point, otherwise the users are able to submit forms using the default values (labels). To achieve this, we&#8217;re going to use some JavaScript checks:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.miniSurveyView input[type=text], textarea'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span>onEnterField<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.miniSurveyView input[type=text], textarea'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span>onEnterField<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.miniSurveyView input[type=text], textarea'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">blur</span><span style="color: #009900;">&#40;</span>onLeaveField<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>These events get raised once a users clicks into a textfield within our form. There we check whether we have to replace the label or not using this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> onEnterField<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">origLabel</span> <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">origLabel</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">value</span><span style="color: #339933;">;</span>
   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">origLabel</span> <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #339933;">||</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">origLabel</span> <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">value</span><span style="color: #009900;">&#41;</span>
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
&nbsp;
	$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">prev</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.formError&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> onLeaveField<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>	
   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">''</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">origLabel</span> <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">origLabel</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>We also add some client side checks to make sure the users has entered all the required fields. This allows us to safe a request and a few milliseconds of waiting.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.miniSurveyView input[type=text], textarea'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span>onEnterField<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.miniSurveyView input[type=text], textarea'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span>onEnterField<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.miniSurveyView input[type=text], textarea'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">blur</span><span style="color: #009900;">&#40;</span>onLeaveField<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.miniSurveyView'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">submit</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> formErrors <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
&nbsp;
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.formError'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input[type=text], textarea'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'origLabel'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> undefined <span style="color: #339933;">||</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'origLabel'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;required&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				formErrors<span style="color: #339933;">++;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">before</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'
&lt;div class=&quot;formError&quot; id=&quot;formError'</span><span style="color: #339933;">+</span>formErrors<span style="color: #339933;">+</span><span style="color: #3366CC;">'&quot; style=&quot;height:18px;color:red;font-size:10px;display:none;&quot;&gt;Bitte Wert eingeben:&lt;/div&gt;
'</span><span style="color: #009900;">&#41;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#formError&quot;</span> <span style="color: #339933;">+</span> formErrors<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">200</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>					
				<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>formErrors <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>
			<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">else</span>
			<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>We check for all fields and make sure the have a value in case they&#8217;re underneath a div with the class &#8220;required&#8221;. We simply display a div above the input fields in case there&#8217;s a value missing.</p>
<p>The template also contains some css rules which I&#8217;m not going to show in this article. They&#8217;re pretty straight forward, but you can also find them here:</p>
<p><a href='http://www.codeblog.ch/wp-content/uploads/2009/07/codeblog.zip'>Download Form Template</a></p>
<p>Extract the zip into &#8220;blocks/form/templates&#8221;. You might have to create the diretories form and templates first!<br />
Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codeblog.ch/2009/07/concrete5-form-layout/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Smart text trimming with PHP</title>
		<link>http://www.codeblog.ch/2009/06/smart-text-trimming-with-php/</link>
		<comments>http://www.codeblog.ch/2009/06/smart-text-trimming-with-php/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 12:56:46 +0000</pubDate>
		<dc:creator>Remo Laubacher</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gd]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[trim]]></category>

		<guid isPermaLink="false">http://www.codeblog.ch/?p=353</guid>
		<description><![CDATA[Have you ever tried to create a short preview text using PHP? Did you just count the characters and ended up having texts with a completely different width like shown on this picture?

This tutorial describes a small method which calculates the real width of a string and lets you create better looking preview texts!

Measuring string [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever tried to create a short preview text using PHP? Did you just count the characters and ended up having texts with a completely different width like shown on this picture?</p>
<p><a href="http://www.codeblog.ch/wp-content/uploads/2009/06/text-trimming.png"><img src="http://www.codeblog.ch/wp-content/uploads/2009/06/text-trimming-300x255.png" alt="text-trimming" title="text-trimming" width="300" height="255" class="alignnone size-medium wp-image-354" /></a></p>
<p>This tutorial describes a small method which calculates the real width of a string and lets you create better looking preview texts!</p>
<p><span id="more-353"></span></p>
<h2>Measuring string width</h2>
<p>PHP offers several methods to measure a string width. You can use the built in method <a target="_blank" href="http://ch2.php.net/manual/en/function.imagefontwidth.php">ImageFontWidth</a> to measure the width of a string using the built in PHP fonts. This is quite easy and works well if you want to create a captcha or something similar, using the PHP fonts.</p>
<p>But there&#8217;s another method which you can easily use to get the complete bounding box of a true type font string. It&#8217;s called <a href="http://ch2.php.net/manual/en/function.imagettfbbox.php">imagettfbbox</a>. The return value is an array which contains several values needed for a bounding box.</h2>
<p>The trimming method</h2>
<p>As you&#8217;ve probably seen on the picure at the beginning of the article, I needed a method that cuts off a string after a certain width and adds a string to indicate that the text isn&#8217;t completely shown. Here&#8217;s some code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> trim_by_width<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span><span style="color: #000088;">$width</span><span style="color: #339933;">,</span><span style="color: #000088;">$font_file</span><span style="color: #339933;">,</span><span style="color: #000088;">$font_size</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">7</span><span style="color: #339933;">,</span><span style="color: #000088;">$append_string</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'...'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$append_string_box</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagettfbbox</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$font_size</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$font_file</span><span style="color: #339933;">,</span><span style="color: #000088;">$append_string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$append_string_width</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$append_string_box</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$str_len</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;=</span><span style="color: #000088;">$str_len</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$trimmed_text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$bounding_box</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagettfbbox</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$font_size</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$font_file</span><span style="color: #339933;">,</span><span style="color: #000088;">$trimmed_text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$trimmed_text_width</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$bounding_box</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$trimmed_text_width</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$append_string_width</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$width</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$str_to_return</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$trimmed_text</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$trimmed_text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$trimmed_text_width</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$str_len</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$str_to_return</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$append_string</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$str_to_return</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$text</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$trimmed_text</span> <span style="color: #339933;">=</span> trim_by_width<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #000088;">$width</span><span style="color: #339933;">,</span> <span style="color: #000088;">$font_file</span><span style="color: #339933;">,</span> <span style="color: #000088;">$font_size</span><span style="color: #339933;">,</span> <span style="color: #000088;">$append_string</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'...'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>$text:<br />
<code>The first parameter is the string which you want to trim</code></p>
<p>$width:<br />
<code>This defines the maximum width of the text in pixels! Not in characters or anything else</code></p>
<p>$font_file:<br />
<code>Here you have to specify the location of your true type font file.</code></p>
<p>$font_size:<br />
<code>The font size you want to use. Please note that unit depends on the version of the GD library you're using. GD1 uses pixels, whereas GD2 uses points</code></p>
<p>$append_string:<br />
<code>An optional string to define the text appended at the end of a trimmed text. By default set to "..."</code></p>
<h2>An example</h2>
<p>You can call the method like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> trim_by_width<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'this is a long text'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">55</span><span style="color: #339933;">,</span><span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/verdana.ttf'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>It assumes that the file verdana.ttf is in the same directory as the php script. It will cut the text &#8220;this is a long text&#8221; after 55 pixels.</p>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codeblog.ch/2009/06/smart-text-trimming-with-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Concrete5 &#8211; Staff listing with two Columns</title>
		<link>http://www.codeblog.ch/2009/06/concrete5-staff-table/</link>
		<comments>http://www.codeblog.ch/2009/06/concrete5-staff-table/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 10:53:30 +0000</pubDate>
		<dc:creator>Remo Laubacher</dc:creator>
				<category><![CDATA[Concrete5]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[columns]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[person]]></category>
		<category><![CDATA[staff]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.codeblog.ch/?p=334</guid>
		<description><![CDATA[Sometimes content should be presented in two columns. In this tutorial I&#8217;ll describe a possible solution that included a very simple block to display a staff/team member with a description on the right side of it. The result will look like this:


Table layouts
I&#8217;m not going into the details about tableless layouts, just a few basic [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes content should be presented in two columns. In this tutorial I&#8217;ll describe a possible solution that included a very simple block to display a staff/team member with a description on the right side of it. The result will look like this:</p>
<p><a href="http://www.codeblog.ch/wp-content/uploads/2009/06/staff1.jpg"><img src="http://www.codeblog.ch/wp-content/uploads/2009/06/staff1-300x212.jpg" alt="staff1" title="staff1" width="300" height="212" class="alignnone size-medium wp-image-335" /></a></p>
<p><span id="more-334"></span></p>
<h2>Table layouts</h2>
<p>I&#8217;m not going into the details about tableless layouts, just a few basic things. The table tag shouldn&#8217;t be used for a layout, using div &#038; css is the way to go. With Concrete5 you could theoretically create two areas but you would then have the problem that the content in the left column doesn&#8217;t have to same margin to the top as the content in the right.</p>
<p>I&#8217;m therefore describing a block that creates a proper div output which you can style using common css rules.</p>
<h2>The staff block</h2>
<p>The block contains only two elements. A picture and a textfield to enter a little note/description about the person.</p>
<p><a href="http://www.codeblog.ch/wp-content/uploads/2009/06/staff2.jpg"><img src="http://www.codeblog.ch/wp-content/uploads/2009/06/staff2-294x300.jpg" alt="staff2" title="staff2" width="294" height="300" class="alignnone size-medium wp-image-336" /></a></p>
<p>The html output will look like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;ccm-person&quot;&gt;
   &lt;div class=&quot;ccm-person-image&quot;&gt;&lt;img src=&quot;http://myserver/remo.jpg&quot; alt=&quot;&quot;&gt;&lt;/div&gt;
   &lt;div class=&quot;ccm-person-description&quot;&gt;Lorem ipsum dolor sit ame.&lt;/div&gt;
   &lt;div style=&quot;clear:both&quot;&gt;&lt;/div&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>Please note that I&#8217;ve added div at the end that uses an inline-style to clear the output. You might want to use a class of your theme but since there&#8217;s no class name that&#8217;s available everything, I&#8217;ve decided to use an inline-style to explain the block!</p>
<p>Without any styling this will generate an output where the text is shown underneath the picture. But since we want to have a table-like layout, we add a few lines to our css file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.ccm-person-image</span> <span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">80px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.ccm-person-description</span> <span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">385px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>This is usually specific to your layout, change it to suit your needs!</p>
<p><a href='http://www.codeblog.ch/wp-content/uploads/2009/06/person.zip'>Download block</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codeblog.ch/2009/06/concrete5-staff-table/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Concrete5 Templates</title>
		<link>http://www.codeblog.ch/2009/03/concrete5-templates/</link>
		<comments>http://www.codeblog.ch/2009/03/concrete5-templates/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 16:52:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Concrete5]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.codeblog.ch/?p=188</guid>
		<description><![CDATA[Concrete5 Custom Templates  DEUTSCH
The Content Management System Concrete5 supports custom templates for existing blocks. Using this feature enables you to modify the layout of the core elements, without actually touching the core, which offers you an easy to way to modify your layout if css isn&#8217;t enough.

In this tutorial we&#8217;re going to modify the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Concrete5 Custom Templates  <a href="http://www.codeblog.ch/2009/03/concrete5-templates/">DEUTSCH</a></strong></p>
<p>The Content Management System Concrete5 supports custom templates for existing blocks. Using this feature enables you to modify the layout of the core elements, without actually touching the core, which offers you an easy to way to modify your layout if css isn&#8217;t enough.</p>
<p><span id="more-188"></span></p>
<p>In this tutorial we&#8217;re going to modify the &#8220;page list&#8221; block. The page list block is quite handy to create a list of sites. Just add a new sub page and the page list block will display it. Could be used for a news list. I already created a list for this tutorial. It looks like this:<br />
<a href="http://www.codeblog.ch/wp-content/uploads/2009/03/delte0.png"><br />
<img src="http://www.codeblog.ch/wp-content/uploads/2009/03/delte0-300x201.png" alt="delte1" title="delte1" width="300" height="201" class="alignnone size-medium wp-image-190" /></a></p>
<p>The sites &#8220;Untereite A&#8221; and &#8220;Unterseite B&#8221; should be part of a list. To achieve this, we&#8217;ll add a page list block to the parent page:</p>
<p><a href="http://www.codeblog.ch/wp-content/uploads/2009/03/delte2.png"><img src="http://www.codeblog.ch/wp-content/uploads/2009/03/delte2-300x201.png" alt="delte2" title="delte2" width="300" height="201" class="alignnone size-medium wp-image-191" /></a></p>
<p>We just created a simple list:</p>
<p><a href="http://www.codeblog.ch/wp-content/uploads/2009/03/delte3.png"><img src="http://www.codeblog.ch/wp-content/uploads/2009/03/delte3-300x201.png" alt="delte3" title="delte3" width="300" height="201" class="alignnone size-medium wp-image-192" /></a></p>
<p>The layout isn&#8217;t perfect, but we can modify the CSS! But what if we want to add a thumbnail? CSS isn&#8217;t enough anymore and we need to create a custom template!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codeblog.ch/2009/03/concrete5-templates/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Concrete5 &#8211; Create your own theme</title>
		<link>http://www.codeblog.ch/2009/01/concrete5-theme-erstellen/</link>
		<comments>http://www.codeblog.ch/2009/01/concrete5-theme-erstellen/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 09:09:51 +0000</pubDate>
		<dc:creator>Remo Laubacher</dc:creator>
				<category><![CDATA[Concrete5]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.codeblog.ch/?p=124</guid>
		<description><![CDATA[Your own site with your own layout &#8211; you want to be unique, don&#8217;t you?
This tutorial will show you, how you can create a Concrete5 Theme within a few minutes.
You should have basic HTML and CSS knowledge. PHP experience isn&#8217;t required, I&#8217;ll explain all the PHP code.
In this tutorial, I&#8217;ll start with a photoshop file [...]]]></description>
			<content:encoded><![CDATA[<p>Your own site with your own layout &#8211; you want to be unique, don&#8217;t you?<br />
This tutorial will show you, how you can create a Concrete5 Theme within a few minutes.</p>
<p>You should have basic HTML and CSS knowledge. PHP experience isn&#8217;t required, I&#8217;ll explain all the PHP code.</p>
<p>In this tutorial, I&#8217;ll start with a photoshop file which I already converted to and HTML/CSS file. If you don&#8217;t have one yet &#8211; find, build or download one before you continue.</p>
<p><a href="http://www.codeblog.ch/wp-content/uploads/2009/01/layout-concrete5.jpg"><img src="http://www.codeblog.ch/wp-content/uploads/2009/01/layout-concrete5-475x325.jpg" alt="" title="layout-concrete5" width="475" height="325" class="alignnone size-medium wp-image-127" /></a></p>
<p><span id="more-124"></span></p>
<p><strong>Elements of a theme</strong></p>
<p>A little overview of all the elements you&#8217;ll find in a theme:<br />
<a href="http://www.codeblog.ch/wp-content/uploads/2009/01/theme-elemente.png"><img src="http://www.codeblog.ch/wp-content/uploads/2009/01/theme-elemente.png" alt="" title="theme-elemente" width="351" height="282" class="alignnone size-medium wp-image-129" /></a></p>
<ul>
<li><strong>elements </strong>- Die directory contains the elements for a template like the header and footer</li>
<li><strong>images </strong>- Sometimes, you&#8217;ll put pictures, like a background image, into a theme which you can&#8217;t edit. Save them here</li>
<li><strong>default.php</strong> &#8211; This is the default file, for pages without a specific page type</li>
<li><strong>description.txt</strong> &#8211; Put the name and a short description in this file, just needed to make sure you&#8217;ll recognize your theme in concrete5</li>
<li><strong>full.php</strong> &#8211; Same as default.php, but this one is used by the pages of where you selected the page type &#8220;full&#8221;</li>
<li><strong>home.php</strong> &#8211; Another layout for page type &#8220;home&#8221;</li>
<li><strong>main.css</strong> &#8211; Save all your CSS rules in main.css</li>
<li><strong>thumbnail.png</strong> &#8211; An icon with the dimension 120&#215;90 pixels which shows your theme</li>
<li><strong>typography.css</strong> &#8211; A second CSS with is used by the wysiwyg editor</li>
<li><strong>view.php </strong> &#8211; the layout for &#8220;single pages&#8221;.</li>
</ul>
<p>All the files of your theme will be saved in a directory. This makes is quite easy, to copy a theme. You can install a theme by copying a directory and a single click in the dashboard.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codeblog.ch/2009/01/concrete5-theme-erstellen/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
	</channel>
</rss>
