<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Markup Separation with Template IT</title>
	<atom:link href="http://www.sitepoint.com/blogs/2007/04/13/markup-separation-with-template-it/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sitepoint.com/blogs/2007/04/13/markup-separation-with-template-it/</link>
	<description>News, opinion, and fresh thinking for web developers and designers. The official podcast of sitepoint.com.</description>
	<pubDate>Thu, 04 Dec 2008 23:28:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: subhash garai</title>
		<link>http://www.sitepoint.com/blogs/2007/04/13/markup-separation-with-template-it/#comment-257423</link>
		<dc:creator>subhash garai</dc:creator>
		<pubDate>Thu, 24 May 2007 08:09:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1900#comment-257423</guid>
		<description>i am having to build a similar type blog
thats why i am looking at it</description>
		<content:encoded><![CDATA[<p>i am having to build a similar type blog<br />
thats why i am looking at it</p>]]></content:encoded>
	</item>
	<item>
		<title>By: jeff</title>
		<link>http://www.sitepoint.com/blogs/2007/04/13/markup-separation-with-template-it/#comment-232946</link>
		<dc:creator>jeff</dc:creator>
		<pubDate>Tue, 24 Apr 2007 16:15:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1900#comment-232946</guid>
		<description>Are you people still talking about this? I laugh in your face. Move on...</description>
		<content:encoded><![CDATA[<p>Are you people still talking about this? I laugh in your face. Move on&#8230;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: mrclay</title>
		<link>http://www.sitepoint.com/blogs/2007/04/13/markup-separation-with-template-it/#comment-229433</link>
		<dc:creator>mrclay</dc:creator>
		<pubDate>Fri, 20 Apr 2007 16:01:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1900#comment-229433</guid>
		<description>To clarify, I was imagining an ECMAscript-based language that would be compiled server-side to native PHP code.</description>
		<content:encoded><![CDATA[<p>To clarify, I was imagining an ECMAscript-based language that would be compiled server-side to native PHP code.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: mrclay</title>
		<link>http://www.sitepoint.com/blogs/2007/04/13/markup-separation-with-template-it/#comment-229420</link>
		<dc:creator>mrclay</dc:creator>
		<pubDate>Fri, 20 Apr 2007 15:34:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1900#comment-229420</guid>
		<description>I think what everyone wants is a template language that's familiar and expressive, but which only provides access to the given data. E.g. no $GLOBALS, $_SERVER, nothing that could trigger errors/halt execution. 

Has anyone thought of a template language based on ECMAscript?</description>
		<content:encoded><![CDATA[<p>I think what everyone wants is a template language that&#8217;s familiar and expressive, but which only provides access to the given data. E.g. no $GLOBALS, $_SERVER, nothing that could trigger errors/halt execution. </p>
<p>Has anyone thought of a template language based on ECMAscript?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Coates</title>
		<link>http://www.sitepoint.com/blogs/2007/04/13/markup-separation-with-template-it/#comment-228817</link>
		<dc:creator>Jeremy Coates</dc:creator>
		<pubDate>Thu, 19 Apr 2007 18:51:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1900#comment-228817</guid>
		<description>There's also PHP &lt;a href="http://www.phpxtemplate.org/" rel="nofollow"&gt;XTemplate&lt;/a&gt; which uses similar markup to that shown but also allows for whole arrays to be assigned, the superglobals and defined elements etc. to be automatically available in the template. Blocks can also be iterated over with ease.

e.g.
&lt;pre&gt;&lt;code class="php"&gt;
include_once('xtemplate.class.php');

// Instantiate the class and pass it the template file name
$xtpl = new XTemplate('mytemplate.xtpl');

// Fake some database style results
$myarray = array(
   0 =&#62; array('name' =&#62; 'apple', 'colour' =&#62; 'green or red', 'an' =&#62; true),
   1 =&#62; array('name' =&#62; 'orange', 'colour' =&#62; 'orange', 'an' =&#62; true),
   2 =&#62; array('name' =&#62; 'pear', 'colour' =&#62; 'green'),
   3 =&#62; array('name' =&#62; 'banana', 'colour' =&#62; 'yellow')
);

foreach ($myarray as $row) {

   // Assign the variable
   $xtpl-&#62;assign('fruit', $row);

   // Check if we need to change our grammar
   if (isset($row['an']) &#38;&#38; $row['an'] == true) {
      $this-&#62;parse('main.row.an');
   }

   // Parse and reset the row for the next iteration
   $xtpl-&#62;parse('main.row');
}

// Parse and output the template
$xtpl-&#62;parse('main');
$xtpl-&#62;out('main');
&lt;/code&gt;&lt;/pre&gt;

And the corresponding template ('mytemplate.xtpl'):

&lt;pre&gt;&lt;code class="html"&gt;
&#60;-- BEGIN: main --&#62;
Here is some fruit:&#60;br /&#62;
&#60;-- BEGIN: row --&#62;
A&#60;-- BEGIN: an --&#62;n&#60;-- END: an --&#62; {fruit.name} is usually {fruit.colour}&#60;br /&#62;
&#60;-- END: row --&#62;
&#60;-- END: main --&#62;
&lt;/code&gt;&lt;/pre&gt;

Should produce the following output:

Here is some fruit:
An apple is usually green or red
An orange is usually orange
A pear is usually green
A banana is usually yellow

(Not that maintaining the project makes me biased in the slightest!)</description>
		<content:encoded><![CDATA[<p>There&#8217;s also PHP <a href="http://www.phpxtemplate.org/" rel="nofollow">XTemplate</a> which uses similar markup to that shown but also allows for whole arrays to be assigned, the superglobals and defined elements etc. to be automatically available in the template. Blocks can also be iterated over with ease.</p>
<p>e.g.</p>
<pre><code class="php">
include_once('xtemplate.class.php');

// Instantiate the class and pass it the template file name
$xtpl = new XTemplate('mytemplate.xtpl');

// Fake some database style results
$myarray = array(
   0 =&gt; array('name' =&gt; 'apple', 'colour' =&gt; 'green or red', 'an' =&gt; true),
   1 =&gt; array('name' =&gt; 'orange', 'colour' =&gt; 'orange', 'an' =&gt; true),
   2 =&gt; array('name' =&gt; 'pear', 'colour' =&gt; 'green'),
   3 =&gt; array('name' =&gt; 'banana', 'colour' =&gt; 'yellow')
);

foreach ($myarray as $row) {

   // Assign the variable
   $xtpl-&gt;assign('fruit', $row);

   // Check if we need to change our grammar
   if (isset($row['an']) &amp;&amp; $row['an'] == true) {
      $this-&gt;parse('main.row.an');
   }

   // Parse and reset the row for the next iteration
   $xtpl-&gt;parse('main.row');
}

// Parse and output the template
$xtpl-&gt;parse('main');
$xtpl-&gt;out('main');
</code></pre>
<p>And the corresponding template (&#8217;mytemplate.xtpl&#8217;):</p>
<pre><code class="html">
&lt;-- BEGIN: main --&gt;
Here is some fruit:&lt;br /&gt;
&lt;-- BEGIN: row --&gt;
A&lt;-- BEGIN: an --&gt;n&lt;-- END: an --&gt; {fruit.name} is usually {fruit.colour}&lt;br /&gt;
&lt;-- END: row --&gt;
&lt;-- END: main --&gt;
</code></pre>
<p>Should produce the following output:</p>
<p>Here is some fruit:<br />
An apple is usually green or red<br />
An orange is usually orange<br />
A pear is usually green<br />
A banana is usually yellow</p>
<p>(Not that maintaining the project makes me biased in the slightest!)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Saumendra Swain</title>
		<link>http://www.sitepoint.com/blogs/2007/04/13/markup-separation-with-template-it/#comment-228267</link>
		<dc:creator>Saumendra Swain</dc:creator>
		<pubDate>Thu, 19 Apr 2007 03:11:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1900#comment-228267</guid>
		<description>There are many Flavour Of Templating System out there. And the basic need of time is how to implement them. Weather its Smarty , Flexi or Template IT or the native PHP templating System, the value out of these comes from its accessibility and ease of use. So The Crux out of all the discussion going here is that Whatever flavour anyone uses it must be a mello-gello for his lips.</description>
		<content:encoded><![CDATA[<p>There are many Flavour Of Templating System out there. And the basic need of time is how to implement them. Weather its Smarty , Flexi or Template IT or the native PHP templating System, the value out of these comes from its accessibility and ease of use. So The Crux out of all the discussion going here is that Whatever flavour anyone uses it must be a mello-gello for his lips.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: BerislavLopac</title>
		<link>http://www.sitepoint.com/blogs/2007/04/13/markup-separation-with-template-it/#comment-226958</link>
		<dc:creator>BerislavLopac</dc:creator>
		<pubDate>Tue, 17 Apr 2007 05:33:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1900#comment-226958</guid>
		<description>When I worked for a small Web dev shop a few years back, we had two designers. Both were quite good in terms of visual talent, but while one was ready and even eager to learn CSS (both used traditional Dreamweaver-generated tag soup beforehand) and adapt his designs to that medium, the other was resolute to never change his design style. So I ordered the latter never to go anywhere near &lt;em&gt;any&lt;/em&gt; HTML, and he would just give me the main layout and any prepared graphics, which would I then transform into HTML+CSS. With this approach we kept a great designer while speeding up the process; before that I would spend days getting this guy's design to a clean state.</description>
		<content:encoded><![CDATA[<p>When I worked for a small Web dev shop a few years back, we had two designers. Both were quite good in terms of visual talent, but while one was ready and even eager to learn CSS (both used traditional Dreamweaver-generated tag soup beforehand) and adapt his designs to that medium, the other was resolute to never change his design style. So I ordered the latter never to go anywhere near <em>any</em> HTML, and he would just give me the main layout and any prepared graphics, which would I then transform into HTML+CSS. With this approach we kept a great designer while speeding up the process; before that I would spend days getting this guy&#8217;s design to a clean state.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: dusoft</title>
		<link>http://www.sitepoint.com/blogs/2007/04/13/markup-separation-with-template-it/#comment-226828</link>
		<dc:creator>dusoft</dc:creator>
		<pubDate>Tue, 17 Apr 2007 00:07:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1900#comment-226828</guid>
		<description>I agree with the above commenters, PHP itself is an exquisite templating system, so there is no reason to invent the wheel over and over again (yes, I am looking at you, Smarty).</description>
		<content:encoded><![CDATA[<p>I agree with the above commenters, PHP itself is an exquisite templating system, so there is no reason to invent the wheel over and over again (yes, I am looking at you, Smarty).</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.sitepoint.com/blogs/2007/04/13/markup-separation-with-template-it/#comment-226768</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Mon, 16 Apr 2007 21:49:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1900#comment-226768</guid>
		<description>I'm sorry but I've been working in the "web" industry for almost 8 years professionally, and I have to say that as a "developer", design and coding to go hand in hand. This may not be an industry standard, but it should be. If you can't build it how can you be expected to design it. We just hired a new guy ( that didn't work out ) and the major issue was that he could design but he couldn't code... so he got the axe. It is my believe that without a knowledge of how sites are built (css, html etc... ) you shouldn't be designing :)</description>
		<content:encoded><![CDATA[<p>I&#8217;m sorry but I&#8217;ve been working in the &#8220;web&#8221; industry for almost 8 years professionally, and I have to say that as a &#8220;developer&#8221;, design and coding to go hand in hand. This may not be an industry standard, but it should be. If you can&#8217;t build it how can you be expected to design it. We just hired a new guy ( that didn&#8217;t work out ) and the major issue was that he could design but he couldn&#8217;t code&#8230; so he got the axe. It is my believe that without a knowledge of how sites are built (css, html etc&#8230; ) you shouldn&#8217;t be designing :)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: pixelsoul</title>
		<link>http://www.sitepoint.com/blogs/2007/04/13/markup-separation-with-template-it/#comment-226673</link>
		<dc:creator>pixelsoul</dc:creator>
		<pubDate>Mon, 16 Apr 2007 19:05:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1900#comment-226673</guid>
		<description>I too have looked many times at what is the best solution for seperating the html from logic.. tried smarty / pattemplate / xslt and what not.. but after doing allot of reading and testing i too think that php itself is the best templating language. I like the way cakephp handles it.

But offcourse whatever works for you :)</description>
		<content:encoded><![CDATA[<p>I too have looked many times at what is the best solution for seperating the html from logic.. tried smarty / pattemplate / xslt and what not.. but after doing allot of reading and testing i too think that php itself is the best templating language. I like the way cakephp handles it.</p>
<p>But offcourse whatever works for you :)</p>]]></content:encoded>
	</item>
</channel>
</rss>
