Problems, need help? Have a tip or advice? Post it here.
10 posts Page 1 of 1
Hello,

There is an amazing tutorial on generating a Gallery here.
All works well.
After creating the gallery there are arrows on admin side which lets you to move albums up and down.
How can we also apply this on the front end? I found k_weight with cms:dump_all command but it also does not help.
Does the table order in backend is only for cosmetic reasons?

Thank you
Hi,

Please try using 'weight' as the value of 'orderby' parameter for <cms:pages> on the front-end.

Does this help?
Hello @KK,

Thanks for the offer. Tried it as well. This is the error I get.

ERROR: Unknown orderby clause "weight"

Code: Select all
<cms:pages masterpage='gallery.php'  order='asc' limit="6"  paginate='1' orderby='weight'>
Ok. Could you please let me know which version of Couch are you using?

You mentioned -
After creating the gallery there are arrows on admin side which lets you to move albums up and down.
- which lead me to believe that you are on Couch v2.0 as earlier versions did not have the arrows you mentioned (and also did not support the 'weight' parameter)..
@KK,

k_cms_version: 1.4.7
k_cms_build: 20151124

Well, in normal nested pages I do not have it:) But the gallery somehow has it. Also when I move it up/down it records it in the couch_pages table in the weight column:D

the cms:dump_all shows k_weight when k_is_page : 1. Actually page is ok but I need to use the variable when I am on k_is_list: 1 because I am generating the pages list in a list page (using cms:pages)
Well, in normal nested pages I do not have it:) But the gallery somehow has it
That is mighty strange as, normally, it should have been the other way around i.e. the nested-pages should show the up/down arrow and not the gallery :)
Perhaps some custom addon is at work?

Anyway, if this sorting is important for you, I suggest you please upgrade to v2.0 as it officially supports this.
It is explained fully in the docs (viewtopic.php?f=5&t=10241) but to paraphrase here is what you need to do -

Place the following within the <cms:template> tag block -
Code: Select all
    <!-- configure admin listing screen -->
    <cms:config_list_view  exclude='default-page' orderby='weight' >
        <cms:field 'k_up_down' />
    </cms:config_list_view>

And now you should get the left/right sort arrows in the admin-panel. For the front-end, you can now use the 'weight' with the cms:pages tag, for example, as follows -
Code: Select all
<cms:pages folder=k_folder_name include_subfolders='0' limit='18' paginate='1' orderby='weight'>
   ...
</cms:pages>

Hope it helps.
@KK thanks again but it did not. I'll try to find another way.
I do not have any addons on this site.

I get the following error when I place the the code your gave.

Code: Select all
    <cms:config_list_view  exclude='default-page' orderby='weight' >
        <cms:field 'k_up_down' />
    </cms:config_list_view>

ERROR! Unknown tag: "config_list_view"


Thanks for helping! :) I might even try version 2 as you said it has this feature!
The code I provided was meant to be used with v2.0.
Please upgrade to that and it should work.
Hello @KK,

So as you offered I have updated to V2.0! Its great btw! :) But still did not solve my issue :(

Adding
Code: Select all
 <!-- configure admin listing screen -->
    <cms:config_list_view  exclude='default-page' orderby='weight' >
        <cms:field 'k_up_down' />
    </cms:config_list_view>

Breaks the couch itself. I only get up and down arrows and only way to get rid of this is to reinstall (or at least the easiest).
Now I do not know what orderby it uses but after upgrading orderby="weight" returns no error but does nothing as well.
tried order asc and desc as well. No, I orders and reorders but not with my liking.

Also one more thing to stress here is after upgradnig I am losing my k_publish_date. If I create a new item it gets a date but old ones are gone.
Please note: This is only valid for nested pages.
Code: Select all
<cms:template title='Gallery' clonable='1' dynamic_folders='1' nested_pages='1' order='20'>
<cms:editable
    type='reverse_relation'
    name='product_photos'
    masterpage='images.php'
    field='photo_product'
    anchor_text='Show Images'
    label='Gallery'
/>
</cms:template>


And I cannot edit the publish date as I used to do from the interface (under the Advances Settings). Again, for the nested pages.
I think I'd like to take a look at your setup @gratas :)

Could you please PM me the FTP+Couch super-admin creds?
Please also mention the names of the problem templates to make it easier for me to find them.

Thanks.
10 posts Page 1 of 1