Macrura

PrevNextTabs

Recommended Posts

PrevNextTabs Module

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

Processwire helper modules for adding page navigation within the editor.

Currently beta state - please use with caution and report all errors or things that don't work as expected.

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.

Screenshot:

screen.png

*note - latest update has minor css adjustment to suit either admin theme.

* edit - should be in modules directory soon...

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

  • Like 21

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

thanks - the latest version should have this already on line 93:

$siblings = $this->editedPage->siblings("include=all");

are you sure you have the latest version?

Share this post


Link to post
Share on other sites

oh yeah, cool, for some reason i thought i fixed it, but i will take care of it and update - many thanks for reporting this!

  • Like 1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

ok - sure, I can add CSS to help this issue - i will try adding  overflow: hidden to the UL and update the module (might not get to it till Sept. as i'm away at the moment...)

  • Like 2

Share this post


Link to post
Share on other sites

Just stepping in to say thanks. Great little module with nice UI for a streamlined content editor workflow.

  • Like 2

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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!

Share this post


Link to post
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..

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

ok sure - thanks for using and testing these;

another small change may be needed once it is tested with the latest version of AdminThemeUIKit, based on some info in the blog post.

  • Like 2

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

ok thanks for the alert - i put quotes around it and upped to 009..

  • Like 2

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

@tpr yes - i noticed this during testing and actually added sort=sort to the selector; do you think it is better to use your version?

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By bernhard
      @Sergio asked about the pdf creation process in the showcase thread about my 360° feedback/survey tool and so I went ahead and set my little pdf helper module to public:
       
      Download & Docs: https://gitlab.com/baumrock/RockPdf
       
      You can combine it easily with RockReplacer: 
       
    • By Soma
      LogMaintenance
      A simple ProcessWire module to give some maintenance control over log files. I found myself often having lots of log files for different things that can grow more or less quickly to a size where they can be difficult to maintain. The built in Logger of PW does a good job of giving you the possibility to delete or prune logs. But it has to be done manually and sometimes a log grows into millions of lines, which makes it often impossible to even prune it as it's too large.
      LogMaintenance uses LazyCron to run the maintenance task and there's several settings you can setup on a global or per log basis.
      Archive: will create zip files for each log file in logs/archive/ folder and add the log each time the maintenance is run to a subfolder containing the datetime.
      Lines: keeps logs to a certain number of lines 
      Days: keeps the log to a certain number of days
      Bytes: keeps the log to a certain amount of bytes
      Each setting is checked from top down, the first setting to contain something is used. So if you check the "Archive" option, all other settings are ignored and logs are archived everytime the LazyCron is executed. If you want to keep your logs to a certain amount of bytes just leave all other settings to 0 or blank.
      Per Log Settings
      There's a textarea that you can use to setup a config for a specific log file one per line. All the logs you define here ignore the global settings above. The syntax for the settings is:
      logname:[archive]:[lines]:[days]:[bytes] 
      errors:1:0:0:0 // would archive the errors log messages:0:10000:0:0 // will prune the errors log to 10000 lines  
      The module can be found on github for you to check out. It's still fresh and I'm currently testing.
      https://github.com/somatonic/LogMaintenance
    • By teppo
      Fieldtype Page IDs is a third party Fieldtype that, simply put, stores Page references as integers (Page IDs).
      This fieldtype was built as a quick and dirty workaround for Page Reference fields' inability handle self-references due to circular reference issues. A project I've been working on for a while now includes a combination of RepeaterMatrix content blocks and tagging/categorization system that would've resulted in a lot of duplicate pages (and plenty of unnecessary manual work for content editors) had I used built-in Page Reference fields, and thus a new Fieldtype felt like the most sensible approach.
      Fieldtype Page IDs was designed to be loosely compatible with Page References in order to make conversions between the two feasible, but it is quite limited feature wise:
      largely due to the fact that stored values are actually just integers with no connection to Pages whatsoever some advanced selectors and related features are not supported, and page values can't be directly accessed configuration settings are limited to the bare essentials (selector string and Inputfield class) only a handful of Inputfields (AsmSelect, Checkboxes, Text) are (currently) supported Anyway, in case you need to store Page IDs (and Page IDs only) and are happy with the limitations mentioned above, feel free to give this Fieldtype a try. It has been working fine for me in one particular project, but hasn't been tested that much, so please tread carefully – and let me know if you run into any issues.
      GitHub repository: https://github.com/teppokoivula/FieldtypePageIDs
      Modules directory: https://modules.processwire.com/modules/fieldtype-page-ids/
    • By daniels
      This is a lightweight alternative to other newsletter & newsletter-subscription modules.
      You can find the Module in the Modules directory and on Github
      It can subscribe, update, unsubscribe & delete a user in a list in Mailchimp with MailChimp API 3.0. It does not provide any forms or validation, so you can feel free to use your own. To protect your users, it does not save any user data in logs or sends them to an admin.
      This module fits your needs if you...
      ...use Mailchimp as your newsletter / email-automation tool ...want to let users subscribe to your newsletter on your website ...want to use your own form, validation and messages (with or without the wire forms) ...don't want any personal user data saved in any way in your ProcessWire environment (cf. EU data regulation terms) ...like to subscribe, update, unsubscribe or delete users to/from different lists ...like the Mailchimp UI for creating / sending / reviewing email campaigns *I have only tested it with PHP 7.x so far, so use on owners risk
      EDIT:
      I've updated the module to 0.0.4. I removed the instructions from this forum, so I don't have to maintain it on multiple places. Just checkout the readme on github 🙂
      If you have questions or like to contribute, just post a reply or create an issue or pr on github. 
    • By bernhard
      WHY?
      This module was built to fill the gap between simple $pages->find() operations and complex SQL queries.
      The problem with $pages->find() is that it loads all pages into memory and that can be a problem when querying multiple thousands of pages. Even $pages->findMany() loads all pages into memory and therefore is a lot slower than regular SQL.
      The problem with SQL on the other hand is, that the queries are quite complex to build. All fields are separate tables, some repeatable fields use multiple rows for their content that belong to only one single page, you always need to check for the page status (which is not necessary on regular find() operations and therefore nobody is used to that).
      In short: It is far too much work to efficiently and easily get an array of data based on PW pages and fields and I need that a lot for my RockGrid module to build all kinds of tabular data.

      Basic Usage

       
      Docs & Download
      https://modules.processwire.com/modules/rock-finder/
      https://gitlab.com/baumrock/RockFinder/tree/master
       
      Changelog
      180528, v1.0.4 add custom select statement option 180516 change sql query method, bump version to 1.0.0 180515 multilang bugfix 180513 beta release <180513 preview/discussion took place here: https://processwire.com/talk/topic/18983-rocksqlfinder-highly-efficient-and-flexible-sql-finder-module/