Jump to content

Manual drag 'n' drop order of pages in PageTable field


alexcapes
 Share

Recommended Posts

Hi,

I'm currently experimenting with using the excellent new PageTable field and have been unable to find an answer to this problem.

When editing a page using the PageTable field, I am able to manually drag'n'drop the child pages created by the field. However when I save this doesn't seem to have any effect on the children that the PageTable field created in the admin PageList tree.

I've tried setting the template with the PageTable field to sort children by 'manual drag n drop' and also tried setting it to sort children by the PageTable field but nothing seems to have an effect.

TL;DR I can't get he manual sort order of pages created with PageTable field to be reflected in the sort order of the admin PageList tree.

gZLJXwh.png?1

(The order in the admin PageList)

D1oRfX9.png?1

(The order in the PageTable field)

Thanks for any help with this!

  • Like 1
Link to comment
Share on other sites

A pagetable field is no representation of the pagetree. It's just another variant of a pagefield with multiselect. Kinda like a advanced asmSelect pagefield. You can even have pages in the pagetree, which aren't in the pagetable. You could write a module, which would sort the fields in the tree after each save, but maybe this can become complex if there are also other "non-pagetable" pages involved.

Edit: The children tab is meant to be used for managing children of a page. 

Link to comment
Share on other sites

A pagetable field is no representation of the pagetree. It's just another variant of a pagefield with multiselect. Kinda like a advanced asmSelect pagefield. You can even have pages in the pagetree, which aren't in the pagetable. You could write a module, which would sort the fields in the tree after each save, but maybe this can become complex if there are also other "non-pagetable" pages involved.

Edit: The children tab is meant to be used for managing children of a page. 

Ah starting to get my head round it.

Is there a way to pull out the pages in a PageTable field in a template in the given 'drag n drop' sort order?

Link to comment
Share on other sites

Swopping out...

$page->children

for

$page->pagetable

throws up errors

Error: Exception: Method Page::pagetable does not exist or is not callable in this context

I can't find reference for "$page->pagetable" anywhere in the docs/forums?

**UPDATE**

I got this working by using the name of the pagetable field not 'pagetable' doh!

Edited by alexcapes
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...