Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Forums / Cotonti / Extensions / Pages order in tag output

#39486 2014-04-28 18:41

Making plugins is just a piece of cake:

Look at here, check readme, download it and install — this is magic box for plugin creation.

Then let's create our simple plugin — look at this :

  1. Set (marked with green) plugin name, check setup file, addition files for our Hooks — `tagsort.first` and `tagsort.pages.query`. Marked wih blue is optional. Other are useless for out plug and should be unchecked.
  2. Add addition info in «Section 2» ( — title, description, author name.

Press «Create extension files». Magic is done. Now we should work a little:

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

Open our generated files (`tagsort.first.php` and `tagsort.pages.query.php`), fix hook names and add corresponding code:

It's never been so easy. :)

Some code explanation (see post above):

  • For `tags.first` we extend drop down selection control with addition «sorting by» values as:  Begin date, author.
  • For `` we alter part of tags search SQL query that sets pages order by our selected «sort by» value.
правильный хостинг —