Jump to content

PrevNextTabs


Macrura
 Share

Recommended Posts

PrevNextTabs Module

Github: https://github.com/outflux3/PrevNextTabs

Processwire helper modules for adding page navigation within the editor.

Overview

This is a very simple module that adds Previous and Next links inline with the tabs on the page editor. Hovering over the tab shows the title of the previous or next page (using the admin's built in jqueryUI tooltips.)

Usage

This module is typically used during development where you or your editors need to traverse through pages for the purpose of proofing, flagging and/or commenting. Rather than returning to the page tree or lister, they can navigate with these links.

Warnings

If you are using PW version 2.6.1 or later, the system will prevent you from leaving the page if you have unsaved edits.

For earlier versions, to avoid accidentally losing changes made to a page that might occur if a user accidentally clicks on one of these, make sure to have the Form Save Reminder module installed.

http://modules.processwire.com/modules/prev-next-tabs/

  • Like 21
Link to comment
Share on other sites

  • 1 month later...

Hi Macrura!

Thanks for this module! It's very cool! It really enhances using pages as a "data container".

Though, I just tried selecting a template that contains hidden pages and it didn't seem to work.

EDIT: I added "include=all" where you check for siblings of the page and it worked. My guess is that it should work even if pages are hidden?

Thanks again!

Link to comment
Share on other sites

  • 5 months later...

Hi Macura, used together with AdminOnSteroids, the module creates a gap under the tabs in my PW setups. If I comment out the css floats for testing, the gap disappears.

It has to to with the height: 2.6em coming from .WireTabs (in combination with the float). If I set height to something else, the gap changes. If I set the UL to overflow: hidden, the gap goes away completely.

 

 

Edited by ceberlin
addition
  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 11 months later...

Super handy, thanks!  I issued a pull request for more efficient query syntax, i.e. using prev() & next().  I have an install with 1700+ siblings and the admin clearly was getting bogged down.  These changes fixed it.

  • Like 3
Link to comment
Share on other sites

thanks - i also responded on github - i think the selector does need to change to optimize this, but somehow i think we need to limit to siblings - what about adding to the selector like parent=$this->editedPage->parent

Link to comment
Share on other sites

  • 3 weeks later...

First, I have been enjoying using this module.  It save time.

I just switched over to the new Admin Theme (UIkit)  and now am having problems using the prev/next.  It seems to work ok on the Default and Reno themes.

Uikit Admin Theme

prev-next-pwuiadminkit.thumb.gif.6df674246749631570cbfc59e1cc7ca7.gif

 

 

Reno Admin Theme

 

 

prev-next-pwreno.thumb.gif.f3886e70658c24bd379a59155dcc5f57.gif

 

 

Default Admin Theme

 

 

prev-next-pwdefault.thumb.gif.09f364c5790d52d884d46cb8a8870e58.gif

Any help you can provide is greatly appreciated.

I have this problem on version 17 and 18 of the AdminUIkit theme.

 

Link to comment
Share on other sites

I can confirm this issue with the Uikit theme.

Here is an idea for the prev-next edit links placement, next to the page title:

prevnexttabs.png.55b729d2f00f78b85405180a09795504.png

And I would use the regular link "title" attribute instead of the tooltip (it just works).

In fact I wanted the add this feature to AOS for a long time but I couldn't find a satisfactory place to them. But now I think this is it :)

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

38 minutes ago, tpr said:

In fact I wanted the add this feature to AOS for a long time but I couldn't find a satisfactory place to them. But now I think this is it :)

I'll try and fix the css to work on UiKit; in the meantime if the prev/next links make it into AOS that would be great, and 1 less module to install and worry about configuring on new sites...

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

1 hour ago, tpr said:

I can confirm this issue with the Uikit theme.

Here is an idea for the prev-next edit links placement, next to the page title:

prevnexttabs.png.55b729d2f00f78b85405180a09795504.png

And I would use the regular link "title" attribute instead of the tooltip (it just works).

In fact I wanted the add this feature to AOS for a long time but I couldn't find a satisfactory place to them. But now I think this is it :)

 

1 hour ago, Macrura said:

I'll try and fix the css to work on UiKit; in the meantime if the prev/next links make it into AOS that would be great, and 1 less module to install and worry about configuring on new sites...

Thanks both.  I guess I will have to finally try AOS.  I've monitored it's progress (since it was published) and I know everyone loves it!  The great thing about ProcessWire, besides the core software, are the great enhancements (contributions) from the community.  There's a lot of very useful stuff being produced on a constant basis.  Plus there are many people from everywhere generously working together to improve things.

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

The module should work ok now on AdminThemeUiKit. The only issue is if you try and use a narrow/mobile view, the tabs may overlap, b/c to get them to be on the right, they have to be absolutely positioned.

  • Like 2
Link to comment
Share on other sites

Works great!   FWIW, I had to enable the tabs in your Admin Help Tab module before things started looking OK in AdminUIKit theme.  However, it could have been some cached display that I was looking at when I first updated the PrevNextTabs module.  Anyway, thanks for the quick response.  This module saves me a lot of time when editing quite a few pages.  Thanks!

Link to comment
Share on other sites

@cstevensjr what was the issue - there are some hacky assumptions with the prev/next tabs, in that they are the last 2 tabs; it's possible that might not always be the case; I will try and see what it looks like with the admin help tab module – it is possible that the combination of those 2 modules may not work right at the moment, may need to force the prev/next tabs to the end or something..

Link to comment
Share on other sites

47 minutes ago, Macrura said:

@cstevensjr what was the issue - there are some hacky assumptions with the prev/next tabs, in that they are the last 2 tabs; it's possible that might not always be the case; I will try and see what it looks like with the admin help tab module – it is possible that the combination of those 2 modules may not work right at the moment, may need to force the prev/next tabs to the end or something..

I'm not sure there is a real problem to troubleshoot.  When I first got the PrevNextTabs upgraded from version 6 to 7, the tabs overlapped on my display with where the Admin Help Tabs were located.  I changed to the Reno Admin theme and then everything worked.  I then changed back to AdminUIKit theme and the PrevNextTasbs were to the right of the screen and working properly. 

I had a combination of things going on at that time (working on my Mac and a new Windows 10 machine) updating other ProcessWire websites and other monitoring tools.  I chalked it up to possible operator error, possible cached after effects or a combination of the two.  I was only glad it worked.  PrevNextTabs is a time saver here.

I started not to mention anything at all, but said what the heck.  Thanks for 2 quality products, which I use every day.

  • Like 1
Link to comment
Share on other sites

@cstevensjr the latest version of the prev/next tabs fixes the issue between the help tab and the prev/next tabs. Also the newer version of the Admin Help module has some fixes; i'm still working on further updates to that module but the latest version on GH should fix some oddities.

  • Like 2
Link to comment
Share on other sites

FYI version 008 caused an 500 error:

Quote

Parse Error:     Invalid numeric literal (line 30 of /var/www/vhosts/XXXXXX//site/assets/cache/FileCompiler/site/modules/PrevNextTabs/PrevNextTabs.module)

Changing the version number from 008 to 8 (no quotes) fixed the issue (plus clear the FileCompiler cache). Running PHP 7.025 here.

As I've read PHP 7 throws an error if the integer starts with a zero, so use it without them or use as a string ("008").

  • Like 1
Link to comment
Share on other sites

preview of upcoming version with some new features:

1) upcoming version lets you place the prev/next links either in the tabs area or in the breadcrumbs (so far only on UiKit):

5a0b24ea252f4_Modules__ProcessWire__localhost.jpg.10aedfac1e9dfc582481621d5bb1047a.jpg

so they look like this (using native UiKit classes):

5a0b24fadccc8_Edit_Page__Soundmanager2_Page_Player__localhost.jpg.c25b8d6127571319acc56cdc703dcd5e.jpg

the labels go away for smaller screens:

5a0b25256d8bf_Edit_Page__Soundmanager2_Page_Player__localhost.jpg.74422a6c2f2e485e36b4c20886b27b6d.jpg

also, supports wrap-around pagination for first and last items:

5a0b2544ed525_Edit_Page__Soundmanager2_Bar_UI__localhost.thumb.jpg.4568bfa93bd4722d181ff4c91d869e82.jpg

Overall i like the pagination up there in the right of the breadcrumbs, better than down in the tabs; This is only possible currently on UiKit theme, because the breadcrumbs are hookable; thanks to @tpr for the idea of the wraparound pagination, and the idea of moving the links out of tabs;

The new version of AOS also has an option for page navigation and is a great alternative to using this module.

this implementation is different in that it is using a hook and changing the markup, rather than adding the links by javascript; also this implementation does allow you to selectively show prev/next pagination based on the template, and the placement of the links it static, in the upper right, whereas the AOS version would move around next to the title. Also this version tooltips the titles of the linked pages.

Edit: The links can now also be moved on Reno Theme:

5a0e2e7b368cb_Edit_Page__Soudmanager2_Cassette__localhost.jpg.c65ab9b6746dce09e62c834ca33296b9.jpg

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

I've noticed that I need to set the sort order to keep the admin page order (this is what users expect I guess).

You can do this like so:

$query = 'include=all, sort=' . $this->editedPage->parent->sortfield . ', parent='.$this->editedPage->parent;

 

  • Like 1
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...