Hello,
I'm trying to use CouchCMS, which seems to be a perfect match for the simple CMS solution I need. I have a problem using OrderBy for ordering clonable pages. I would like to show a summary of the individual pages on the default/parent page, by using the sort order I want. I found some information about this OrderBy feature on this forum, but that doesn't seem to help me to solve my problem. I also checked the documentation, that says:
http://www.couchcms.com/docs/tags-reference/pages.html
I made the most simple page I can imagine to break down the problem. I would expect to be able to sort on the field SortOrder. But even this example gives me an error.
Can someone give me a clue on what I'm doing wrong? I use CouchCMS v1.4.
Thanks for your help!
I'm trying to use CouchCMS, which seems to be a perfect match for the simple CMS solution I need. I have a problem using OrderBy for ordering clonable pages. I would like to show a summary of the individual pages on the default/parent page, by using the sort order I want. I found some information about this OrderBy feature on this forum, but that doesn't seem to help me to solve my problem. I also checked the documentation, that says:
http://www.couchcms.com/docs/tags-reference/pages.html
Orderby
The pages fetched can be sorted and ordered according to the following fields
....
Apart from the fields mentioned above, any of the custom field defined in the template (...) may be used for sorting the fetched pages.
I made the most simple page I can imagine to break down the problem. I would expect to be able to sort on the field SortOrder. But even this example gives me an error.
- Code: Select all
ERROR: Unknown orderby clause "sortorder"
Can someone give me a clue on what I'm doing wrong? I use CouchCMS v1.4.
Thanks for your help!
- Code: Select all
<?php require_once( '/couch/cms.php' );?>
<cms:template title='Order' clonable='1' commentable='0'>
<cms:editable name='SortOrder' label='Sort order' type='text' search_type='integer' />
<cms:editable name='Text' label='The text' type='text' />
</cms:template>
<cms:if k_is_page >
<!-- this is shown when the page is called seperately e.g. order.php?p=1 -->
<html>
<body>
<cms:show SortOrder/> : <cms:show Text/><br>
</body>
</html>
<cms:else />
<!-- this is shown when the default main page is called e.g. order.php. I expect the data is sorted by using the values of the field SortOrder -->
<html>
<body>
<cms:pages order='asc' orderby='SortOrder'>
SortOrder = <cms:show SortOrder /><br>
Text = <cms:show Text /><br>
</cms:pages>
</body>
</html>
</cms:if>
<?php COUCH::invoke(); ?>