Jump to content

PrevNextTabs


Macrura
 Share

Recommended Posts

On 11/14/2017 at 11:39 PM, tpr said:

Yes, as it takes the custom sort order into account, that you can set in the Children tab of the parent page. By default it falls back to"sort".

@tprThe docs say:

If your parent page(s) are not already sorting by a specific field, you may still tell the $pages->find() to sort by the parent's order by specifying "sort=sort" in your selector

http://processwire.com/api/selectors/#sort

so i would guess that all you need is sort=sort, and not the way you suggested (?)

Link to comment
Share on other sites

No, that tells that you always need to add sort=sort to ensure the admin sort order. I've used sort=sort in aos but noticed that custom sort order needs additional work. You can check it by adding a custom sort order to the parent page, and then see how the prev-next link targets are out of sync.

Link to comment
Share on other sites

23 hours ago, tpr said:

No, that tells that you always need to add sort=sort to ensure the admin sort order. I've used sort=sort in aos but noticed that custom sort order needs additional work. You can check it by adding a custom sort order to the parent page, and then see how the prev-next link targets are out of sync.

ok thanks - gonna fix this next.

Link to comment
Share on other sites

  • 2 years later...

The module has been updated and now loads the prev/next links via ajax, which should hopefully solve any issues with the module potentially slowing down the page editor load.

The work of finding the prev/next pages is handled by an ajax request after the editor is loaded. Been tested on all 3 admin themes, with link locations in breadcrumbs and in tabs.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 4 years later...

Hi @Macrura,

thanks for this module.
I have played a bit and found it useful, but at first time not very friendly. I try to explain...

The Next/Prev links seems like to be in "loop" when at last/first items; I feel it quite unfriendly and not very helpful.
When lot of siblings are present, it's difficult to understand if we are at the beginning or ending to stop editing/checking pages (for example, I find very annoying when you click on "Save + Next" and only then the message "no next page found" appears...)


But your work is very  intersting, so I tried to edit your code (I forked it from your repo and pulled a request).
Basically, I think that if the next or prev page id is "0", so we can decide to hide the relative links and show First/Last, as needed.

I added few code lines into your module to implement last and first placeholders and labels, new logics into .js file to check ajax response (ids and urls) and few rules into .css file.

Also added a condition to hide links if only one items is present (so no navigation needed).

1441261413_1-Only1item.thumb.jpg.5630631a7a9d3175d7a828fad664b7a1.jpg

 

 

 

 

 

 

Currently I tested all only in Tabs, and all works fine.

1208470976_2-Firstitem.thumb.jpg.2fc933af32b3a34662b36c7cef18a369.jpg


 

 

 

1655974333_3-Lastitem.thumb.jpg.61866847dc100b6cf42a13b54697f053.jpg

 

 

 

Hope this could be helpful.
I think I will try to insert also a link to parent page (just to complete a full nav "scheme"), and maybe to go further and finish the editin also for UI specific settings.

 

PS This idea was initially born implementing new actions for Save and Next admin button (se here the post).

Edited by Cybermano
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...