<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Pages order in tag output</title>
		<link>https://www.cotonti.com</link>
		<description>Последние сообщения в теме</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Mon, 20 Apr 2026 17:46:40 -0000</pubDate>

		<item>
			<title>staleo</title>
			<description><![CDATA[<p>All right, here's the solution we found.</p>

<p>1. In a table <strong>cot_config</strong> we search a required setting with a query:</p>

<p>SELECT *<br />
FROM `cot_config`<br />
WHERE `config_owner` = 'plug'<br />
AND `config_cat` = 'tags'<br />
AND `config_name`='sort'</p>

<p>2. Here we add a required field. If you need to sort pages by <strong>page_begin</strong>, just add <strong>begin</strong> (without <strong>page_</strong>).</p>

<p>3. Here we go! In the Tags plugin settings, find a dropdown menu with the options how to sort pages with the same tag. Choose <strong>Begin</strong>.</p>

<p>Voila! For this short manual, we send deepest thanks to <em><strong>Nastya Kizza</strong></em>. :)</p>

<p>p.s. Thx to Macik anyway!</p>
]]></description>
			<pubDate>вт, 20 мая 2014 18:10:06 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/ru/forums?m=posts&q=7726&d=0#post39530]]></link>
		</item>
		<item>
			<title>Macik</title>
			<description><![CDATA[<blockquote>
<p> Now it's all fine, it works. But I was actually planning to hide the sorting options, just leaving the "By begin date" as a default method of sorting pages. A<span style="line-height:1.6em;">re there any ways of doing so?</span></p>
</blockquote>

<pre class="brush:php;">
This way it's faster to do it via edit template `tags.tpl` and replace:</pre>

<pre class="brush:xml;">
&lt;select name="order"&gt;
	&lt;option value=""&gt;{PHP.L.tags_Orderby}&lt;/option&gt;
	&lt;option value=""&gt;--&lt;/option&gt;
	{TAGS_ORDER}
&lt;/select&gt;</pre>

<p>with:</p>

<pre class="brush:xml;">
&lt;input type="hidden" name="order" value="begin" /&gt;</pre>

<p>Then you can stop <span style="color:rgb(68,68,68);font-family:sans-serif;background-color:rgb(238,238,238);">`tags.first`</span><span style="font-size:13px;line-height:1.6em;"> part of plugin, leaving only </span><span style="font-size:13px;line-height:1.6em;color:rgb(68,68,68);font-family:sans-serif;background-color:rgb(238,238,238);">`tagsort.pages.query`</span><span style="font-size:13px;line-height:1.6em;">.</span></p>

<blockquote>
<p><span style="font-size:13px;line-height:1.6em;">Also, if you have any ideas on another Tags issue, welcome! Here's the topic: http://www.cotonti.com/forums?m=posts&amp;q=7730.</span></p>
</blockquote>

<p>I'll check it later.</p>
]]></description>
			<pubDate>пт, 02 мая 2014 15:53:27 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/ru/forums?m=posts&q=7726&d=0#post39497]]></link>
		</item>
		<item>
			<title>staleo</title>
			<description><![CDATA[<p><strong>Macik,</strong></p>

<p>Of course I messed everything up. :)</p>

<blockquote>
<ul style="margin:.8em;padding-right:0px;padding-left:0px;border:0px;vertical-align:baseline;background-color:rgb(238,238,238);list-style-position:inside;line-height:1.6em;color:rgb(68,68,68);font-family:sans-serif;"><li style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;">For `tags.first` we extend drop down selection control with addition «sorting by» values as:  Begin date, author.</li>
</ul></blockquote>

<p>For some reason, I thought you imply the sorting values in the Tags plugin settings (http://domain.com/admin/config?n=edit&amp;o=plug&amp;p=tags), while in fact you were meaning the sorting options on the actual tags output page (http://domain.com/tags/bla-bla-tah-here). Now it's all fine, it works. But I was actually planning to hide the sorting options, just leaving the "By begin date" as a default method of sorting pages. A<span style="line-height:1.6em;">re there any ways of doing so?</span></p>

<p>Thank you in advance!</p>
<p><strong>Добавлено 4 минуты спустя:</strong></p><p><strong>Macik,</strong></p>

<p>Also, if you have any ideas on another Tags issue, welcome! Here's the topic: http://www.cotonti.com/forums?m=posts&amp;q=7730.</p>
]]></description>
			<pubDate>чт, 01 мая 2014 19:08:10 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/ru/forums?m=posts&q=7726&d=0#post39493]]></link>
		</item>
		<item>
			<title>Macik</title>
			<description><![CDATA[<blockquote>
<p>Thank you for a such a broad descriprion of how your plugin works, but anyway, for some reason, your solution didn't work for me properly. Here's the <strong>tagsort</strong> plugin <a href="http://joxi.ru/nNheUxjKTJByDnIHAZc" rel="nofollow">http://joxi.ru/nNheUxjKTJByDnIHAZc</a> — that seems, the <strong>tags.first</strong> hook simply doesn't correspond with the <strong>Tags</strong> plugin settings. There are 4 options of how to sort the pages, just like it used to be, no "Author", no "Begin date", nothing.</p>

<p>I could of course make some mistake, and your help with it would be very much appreciated.</p>
</blockquote>

<p><span style="font-size:13px;line-height:1.6em;">It's quite strange. </span></p>

<p>I had checked you archive and it works fine for me — http://screenshot.galaxyhost.org/img/20140501-5q3-35kb.jpg</p>

<p>What about versions that you use (Cotonti and Tags plugin)?</p>

<p><span style="font-size:13px;line-height:1.6em;">I use Siena version and</span></p>

<p>Version=0.9.14<br />
Date=2012-02-19</p>

<p>of `Tags` plugin </p>

<blockquote>
<p>Above that, if you don't mind, I found an issue, which could be rather important for your plugin users, particularly for those like me, lacking the experience of writing plugins for their needs. Right after filling up the second section, "Misc", I found out that clicking "Submit" simply doesn't change anything. No output, no answer, the button just leaves everything how it was. I tried refilling the data 3 or 4 times, before I cought what was wrong. The issue here is that user doesn't know where exactly plugin tries to create a subfolder /created. The right answer is: in /datas, but who knows that? :) Therefore, this could be a good idea to give user a short hint, like, "Make /datas writable, we will do the rest", or something.</p>
</blockquote>

<p>Thank you for your opinion.</p>

<p>First of all. it should be displayed Log message (like here: <a href="http://screenshot.galaxyhost.org/img/20140501-bpb-62kb.jpg" rel="nofollow">http://screenshot.galaxyhost.org/img/20140501-bpb-62kb.jpg</a> )<br />
As for target dir, you are right — I forgot that by default its location is `datas/created/`. It can be altered via plugin settings.</p>
]]></description>
			<pubDate>чт, 01 мая 2014 16:29:49 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/ru/forums?m=posts&q=7726&d=0#post39492]]></link>
		</item>
		<item>
			<title>staleo</title>
			<description><![CDATA[<p>Macik,</p>

<p>Thank you for a such a broad descriprion of how your plugin works, but anyway, for some reason, your solution didn't work for me properly. Here's the <strong>tagsort</strong> plugin <a href="http://joxi.ru/nNheUxjKTJByDnIHAZc" rel="nofollow">http://joxi.ru/nNheUxjKTJByDnIHAZc</a> — that seems, the <strong>tags.first</strong> hook simply doesn't correspond with the <strong>Tags</strong> plugin settings. There are 4 options of how to sort the pages, just like it used to be, no "Author", no "Begin date", nothing.</p>

<p>I could of course make some mistake, and your help with it would be very much appreciated.</p>

<p>Above that, if you don't mind, I found an issue, which could be rather important for your plugin users, particularly for those like me, lacking the experience of writing plugins for their needs. Right after filling up the second section, "Misc", I found out that clicking "Submit" simply doesn't change anything. No output, no answer, the button just leaves everything how it was. I tried refilling the data 3 or 4 times, before I cought what was wrong. The issue here is that user doesn't know where exactly plugin tries to create a subfolder /created. The right answer is: in /datas, but who knows that? :) Therefore, this could be a good idea to give user a short hint, like, "Make /datas writable, we will do the rest", or something.</p>
]]></description>
			<pubDate>пн, 28 апр 2014 22:51:11 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/ru/forums?m=posts&q=7726&d=0#post39487]]></link>
		</item>
		<item>
			<title>Macik</title>
			<description><![CDATA[<p>Making plugins is just a piece of cake:</p>

<p>Look at <a href="https://github.com/macik/cot-extension_template" rel="nofollow">here</a>, check readme, download it and install — this is magic box for plugin creation.</p>

<p>Then let's create our simple plugin — look at this <a href="http://screenshot.galaxyhost.org/img/20140428-75f-72kb.jpg" rel="nofollow">http://screenshot.galaxyhost.org/img/20140428-75f-72kb.jpg</a> :</p>

<ol><li>Set (marked with green) plugin name, check setup file, addition files for our <strong>Hooks</strong> — `tagsort.first` and `tagsort.pages.query`. Marked wih blue is optional. Other are useless for out plug and should be unchecked.</li>
	<li>Add addition info in «Section 2» (<a href="http://screenshot.galaxyhost.org/img/20140428-5mp-48kb.jpg" rel="nofollow">http://screenshot.galaxyhost.org/img/20140428-5mp-48kb.jpg</a>) — title, description, author name.</li>
</ol><p>Press «Create extension files». <a href="http://screenshot.galaxyhost.org/img/20140428-wb5-19kb.jpg" rel="nofollow">Magic is done</a>. Now we should work a little:</p>

<p>Locate files in `plugins/extension_template/created/tagsort`, copy it to plugins folder as usual plug. </p>

<p>Open our generated files (`tagsort.first.php` and `tagsort.pages.query.php`), fix hook names and add corresponding code:<br /><a href="http://screenshot.galaxyhost.org/img/20140428-dob-66kb.jpg" rel="nofollow">http://screenshot.galaxyhost.org/img/20140428-dob-66kb.jpg</a> <br /><a href="http://screenshot.galaxyhost.org/img/20140428-gs7-42kb.jpg" rel="nofollow">http://screenshot.galaxyhost.org/img/20140428-gs7-42kb.jpg</a></p>

<p>It's never been so easy. :)</p>

<p>Some code explanation (see post above):</p>

<ul><li>For `tags.first` we extend drop down selection control with addition «sorting by» values as:  Begin date, author.</li>
	<li>For `tags.search.pages.query` we alter part of tags search SQL query that sets pages order by our selected «sort by» value.</li>
</ul><p> </p>

<p> </p>
]]></description>
			<pubDate>пн, 28 апр 2014 18:41:25 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/ru/forums?m=posts&q=7726&d=0#post39486]]></link>
		</item>
		<item>
			<title>staleo</title>
			<description><![CDATA[<p><strong>Macik,</strong></p>

<p>Thank you for the info, but unfortunately I lack the experience of writing the plugins, as well as have a rather weak understanding of what you imply by hooks, and how the latter deal with the former. If this doesn't bother you, can you please explain how do I implement your solution step by step? I'd appreciate it a lot!</p>

<p>Thank you again.</p>
]]></description>
			<pubDate>пн, 28 апр 2014 10:35:24 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/ru/forums?m=posts&q=7726&d=0#post39485]]></link>
		</item>
		<item>
			<title>Macik</title>
			<description><![CDATA[<p>This functionallity is hard coded in <strong>Tags</strong> plugin. So you can not alter it simply with settings.</p>

<p>But it's a flexible enough to be extended with other plugin for this. </p>

<p>So you can write simple plugin with 2 hooks:</p>

<ul><li>on «<strong>tags.search.pages.query</strong>» hook</li>
</ul><pre class="brush:php;">
	// check is it possible to sort by this field
	if ($db-&gt;fieldExists($db_pages,'page_'.$o)) {

		$order = 'ORDER BY `page_'.$o.'`';
	}
</pre>

<ul><li>on «<strong>tags.first</strong>» hook

	<pre class="brush:as3;">
// column =&gt; title
$addition_fields = array(
	'begin' =&gt; 'Begin date',
	'author' =&gt; 'Author',
	// on so on — any page field
);
foreach ($addition_fields as $order=&gt;$title)
{
	$ord = mb_strtolower($order);
	$selected = $ord == $o ? 'selected="selected"' : '';
	$tag_order .= cot_rc('input_option', array('value' =&gt; $ord, 'selected' =&gt; $selected, 'title' =&gt; $title));
}
</pre>

	<p> </p>
	</li>
</ul>]]></description>
			<pubDate>вс, 27 апр 2014 09:57:55 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/ru/forums?m=posts&q=7726&d=0#post39484]]></link>
		</item>
		<item>
			<title>staleo</title>
			<description><![CDATA[<p>Hi all,</p>

<p>I got a question on how to sort the pages with the same tag. In the plugin settings, there are four options to choose from: to sort pages by id, by date, by title, and by category. Dear community, how do I sort the pages <strong>by begin date</strong>?</p>

<p>Thanks in advance,</p>

<p>Cheers.</p>
]]></description>
			<pubDate>пт, 25 апр 2014 22:31:57 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/ru/forums?m=posts&q=7726&d=0#post39476]]></link>
		</item>
	</channel>
</rss>