Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
If you add a new editable region to a template it will appear last in the Admin Panel. I know that I can override this behaviour by adding the parameter 'order'
Code: Select all
<cms:editable 
    type='richtext'
    name='page_content3'
    label='NEW FIELD'
    order='1'
/>


BUT as a template gets large and includes embedded snippets as well it becomes a bit of a nightmare trying to get the ordering as you want it. Especially if I am re-using snippets in different templates.

I would like the order of editable regions in the Admin Panel to be as they are in the template without needing to assign an order value. i.e. I want to stop Couch from ordering them by date. How can I achieve this?
Normally, we define editables inside <cms:template> </cms:template> block. I personally see no problem about copy-pasting order='' and then adding numbers. Sometimes I put a negative number, especially if editable must appear on top, while added to template on late stages.
I prefer setting order with tenths - 10,20,30 instead of 1,2,3 -> this helps to add some editable between, putting order='15' etc.
Also I use groups, which kinda restarts ordering - if you put editable in group order will be counted towards the rest of eds in group.

I didn't follow, why you mentioned snippets since each template has independent ordering of its editables. Of course, it'd be a problem for you if you keep editables along with code, which I personally find very confusing and not centralized inside cms:template.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
... a typical embedded snippet which I would place inside the <cms:template> tag might be whole bunch of editable regions for uploading images, setting up captions, titles and so on. And this snippet would be useful to embed in any template where I want the client to be able to upload images. But of course I don't always want this snippet to have say, "order=50".

To me the requirement to specify an 'order' impacts on the efficiency of re-usable snippets of code containing editable regions.

So for my purposes and the way I like to organise my Couch templates it would be a bonus if someone is able to suggest a way of stopping Couch ordering <cms:editable> by date or by the 'order' parameter!
I totally get your point and have same use-case.
Let me add just a bit more to it.

For example, we can use a following construction inside cms:template block:
Code: Select all
<cms:if "<cms:exists "editables/<cms:show k_template_name />.html" />" >
  <cms:embed "editables/<cms:show k_template_name />.html" />
</cms:if>

This way each template can have a separate html file inside /snippets/editables with a name containing name of template. Sample: editables/index.php.html, editables/admin/users.php.html, etc..

Snippet with editables will be automatically embedded once the file is in place.
In my experience, having over 40 templates and several hundreds of snippets, there is no problem copy-pasting the file and making slight changes (order etc) in it, if same order is not desired for another( with identical editables )template.

it would be a bonus if someone is able to suggest a way of stopping Couch ordering <cms:editable> by date or by the 'order' parameter!

Getting to above request - essentially this will never be possible in current conditions, since database has no traces of physical order of eds in files. Couch orders editables either by id( auto-assigned by MySQL at the moment of introducing the editable ) or the order.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
4 posts Page 1 of 1