<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : page templates idea</title>
		<link>https://www.cotonti.com</link>
		<description>Laatste forum onderwerpen</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Fri, 01 May 2026 09:08:32 -0000</pubDate>

		<item>
			<title>singh336</title>
			<description><![CDATA[<p>nice nice</p>
]]></description>
			<pubDate>Ma, 02 Dec 2013 22:23:03 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6586&d=0#post38708]]></link>
		</item>
		<item>
			<title>Twiebie</title>
			<description><![CDATA[<p>I already did just that a few days ago haha. :)</p>

<p>Here's the plugin if anyone needs it: <a href="http://www.cotonti.com/datas/users/pagetpl_897.zip">http://www.cotonti.com/datas/users/pagetpl_897.zip</a></p>
]]></description>
			<pubDate>Zo, 29 Sep 2013 23:34:40 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6586&d=0#post38062]]></link>
		</item>
		<item>
			<title>Macik</title>
			<description><![CDATA[<blockquote><a href="https://www.cotonti.com/forums?m=posts&amp;q=6586#38050">#38050</a> <strong>Twiebie: </strong>
<p>Pfff, I've had this problem with several client websites where I wanted to use the system category for multiple pages with different TPL's.</p>

<p>Glad I stumbled upon that bit of code, guys!</p>

<p>Thanks.</p>
</blockquote>

<p>Make a simple plugin. hook it on `page.main`. Code it as follows:</p>

<pre class="brush:php;">
if ($cat['tpl'] == 'system') {
  $mskin = cot_tplfile(array('page', $cat['tpl'], empty($al) ? $id : $al));
}</pre>

<p>use templates named as: `<strong>page.system.#alias.tpl</strong>` or `<strong>page.system.#id.tpl</strong>`  (where <strong>#alias</strong> and <strong>#id</strong> is alias or id of corresponding page), located in standard page.tpl folders.</p>

<p><u>Note1:</u> be sure to use alias if it exists for current page<br /><u>Note2:</u> be sure not to use special symbols in page alias that can not be used as file name symbols</p>
]]></description>
			<pubDate>Zo, 29 Sep 2013 20:47:02 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6586&d=0#post38058]]></link>
		</item>
		<item>
			<title>Twiebie</title>
			<description><![CDATA[<p>Pfff, I've had this problem with several client websites where I wanted to use the system category for multiple pages with different TPL's.</p>

<p>Glad I stumbled upon that bit of code, guys!</p>

<p>Thanks.</p>
]]></description>
			<pubDate>Vr, 27 Sep 2013 22:50:40 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6586&d=0#post38050]]></link>
		</item>
		<item>
			<title>ez</title>
			<description><![CDATA[<p>
	Thanks you all, it was a very fast idea..., and yes i do know that the code will break down, and that it was not perfect.... But this was all about the idea, and that came through, so mission accomplished (for my part). Now just the correct code is needed, but that can be developped fast i think....</p>
]]></description>
			<pubDate>Wo, 02 Nov 2011 18:01:03 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6586&d=0#post31290]]></link>
		</item>
		<item>
			<title>esclkm</title>
			<description><![CDATA[<p>
	I think its good idea for little plugin)))</p>
]]></description>
			<pubDate>Wo, 02 Nov 2011 17:55:19 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6586&d=0#post31289]]></link>
		</item>
		<item>
			<title>GHengeveld</title>
			<description><![CDATA[<p>
	I like your idea. Especially for 'system' pages this will be useful. Using page_text to insert the HTML is very dirty, inefficient and limited, so the addition of custom tpl files for individual pages is welcome.</p>
<p>
	Your implementation won't work (correctly), because it will break category tpl files. cot_tplfile will look for a template file matching page.myalias.mycategory.tpl, will probably fail, try page.myalias.tpl, maybe fail and finally return page.tpl. It will never look for page.mycategory.tpl anymore. You need an alternative approach. Try this:</p>
<pre class="brush:java;">
if ($pag['page_alias'])
{
	$alskin = cot_tplfile(array('page', 'al-'.$pag['page_alias']));
	if (!strpos($alskin, 'page.al-'.$pag['page_alias'])) $alskin = '';
}
$mskin = ($alskin) ? $alskin : cot_tplfile(array('page', $cat['tpl']));
$t = new XTemplate($mskin);</pre>
<p>
	Note that this is Siena code, not Genoa like yours, so you'll need to adapt it a little. I've also added the prefix al- to the filename to avoid confusion with category tpl files.</p>
]]></description>
			<pubDate>Wo, 02 Nov 2011 11:50:36 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6586&d=0#post31285]]></link>
		</item>
		<item>
			<title>ez</title>
			<description><![CDATA[<p>
	@Dyllon: Its not about the page text, its about layouting the complete page  (So all fields...)</p>
<p>
	@Kort: Thanks, I think all designers will like this one... ?</p>
<p>
	I havent tried it YET with the page.edit.... stuff yet, But i can imagine that designers want to have that there too.. e.g. A FIXED page that should not have the Alias field and the delete option.  (This to prevent the client to either delete the page, or change the alias.... or any other fixed field.... )</p>
]]></description>
			<pubDate>Wo, 02 Nov 2011 09:39:37 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6586&d=0#post31283]]></link>
		</item>
		<item>
			<title>Kort</title>
			<description><![CDATA[<p>
	<strong>ez:</strong> nice suggestion. i'd say it is far better than playing with alias-based conditions in a category tpl. in general, balancing between the number of templates and their "readability" depends on the project requirements and the skinmaker style, so i'm afraid there is no such thing as "ideal" here.</p>
]]></description>
			<pubDate>Wo, 02 Nov 2011 07:14:46 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6586&d=0#post31281]]></link>
		</item>
		<item>
			<title>Dyllon</title>
			<description><![CDATA[With the ability to parse HTML through page text I find this kind of situational for most people. For most cases having a separate tpl per category is ideal... But, good work! ]]></description>
			<pubDate>Di, 01 Nov 2011 23:06:50 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6586&d=0#post31280]]></link>
		</item>
		<item>
			<title>ez</title>
			<description><![CDATA[<p>
	If you do this (see below), it is very simple to make a separate TPL for a single page. based on the Alias.. This is a very minimal addition, but gives a great freedom with designing. I now have a page.[pagealias].tpl which i can use to design one single page :)</p>
<pre class="brush:php;">
require_once $cfg['system_dir'] . '/header.php';

$mskin = sed_skinfile(array('page', $pag['page_alias'], $sed_cat[$pag['page_cat']]['tpl']));
$t = new XTemplate($mskin);
</pre>
<p>
	Hope this will help someone.. By the way it can be found in page.inc.php line 161 (around)</p>
]]></description>
			<pubDate>Di, 01 Nov 2011 20:40:34 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6586&d=0#post31278]]></link>
		</item>
	</channel>
</rss>