Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi there

I have some clonable pages for 'processes' which includes an editable type='relation' which then points to a template called 'process_tags.php' which is as follows:

Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Process Tags' clonable='1' order='2' ></cms:template>
<cms:config_list_view orderby='weight' order='asc'>
<cms:field 'k_selector_checkbox' />
<cms:field 'k_page_title' sortable='0' />
<cms:field 'k_up_down' />
<cms:field 'k_actions' />
</cms:config_list_view>
<?php COUCH::invoke(); ?>


This works nicely, in that it allows users to create 'tags' which they can then apply to each process page. This in turn allows visitors to the site to filter by tag. I have got all of this working, but I had been hoping that by including the config_list_view code in the above example it would be possible to manually arrange the 'tags' into a preferred order and that, in the editor view for a process page, the list of checkboxes produced by the editable region type='relation' would appear in this order. I am not sure what order they are appearing in (I think it's publish_date and desc by default??) but manually re-arranging the order of pages in the "Process Tags" editor does not achieve any change in the order in which the tags appear in the "Processes" page editor. The documentation on the 'orderby' for "type='relation'" does not seem to suggest a way of inheriting the order from the manually set 'config_list_view'?

Is there a 'correct' way to achieve this? It is simply that we may end up with many, many tags being created, and ideally (since these 'pages' are being used to document 'step-by-step processes') they would present in the same order as the steps in the processes being documented - which is always going to have to be done manually - but at present they appear in a seemingly random order (at least they appear random to the end user who would expect to see a list of tags like "Step A", "Step B", "Step C" ... but instead it goes "Step G", "Step B", "Step E" etc.).

Thank you for any help you can provide.

Anthony

Hi,

You can tweak the order of the checkboxes by setting 'orderby' and 'order_dir' params of the type 'relation' editable region e.g. as follows for your use-case -
Code: Select all
<cms:editable type='relation' orderby='weight' 'order_dir'='asc' name='..

Possible values for 'orderby' are 'publish_date', 'page_title', 'page_name' or 'weight'.
Possible values for 'order_dir' are 'desc' or 'asc'.

Don't forget to refresh the modified template as super-admin.

Hope this helps.

Hi KK

That worked perfectly - in hindsight, the documentation for the 'relation' tag shows this, but I was struggling to put the pieces together in my mind. For some reason the challenge was that I had been trying to use "orderby='weight' order='asc'" whereas I see now that we need order_dir in this instance.

Thank you!

Anthony
3 posts Page 1 of 1
cron