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 2
  • 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 flydev
      PulsewayPush
      Send "push" from ProcessWire to Pulseway.
       
      Description
      PulsewayPush simply send a push to a Pulseway instance. If you are using this module, you probably installed Pulseway on your mobile device: you will receive notification on your mobile.
      To get more information about Pulseway, please visit their website.
      Note
      They have a free plan which include 10 notifications (push) each day.
       
      Usage
      Install the PulsewayPush module.
      Then call the module where you like in your module/template code :
      <?php $modules->get("PulsewayPush")->push("The title", "The notification message.", "elevated"); ?>  
      Hookable function
      ___push() ___notify() (the two function do the same thing)
       
      Download
      Github:  https://github.com/flydev-fr/PulsewayPush Modules Directory: https://modules.processwire.com/modules/pulseway-push/  
      Examples of use case
      I needed for our work a system which send notification to mobile device in case of a client request immediate support. Pulseway was choosen because it is already used to monitor our infrastructure.
      An idea, you could use the free plan to monitor your blog or website regarding the number of failed logins attempts (hooking Login/Register?), the automated tool then block the attacker's IP with firewall rules and send you a notification.
       

       
      - - - - - - - - - - - - - -
      11-22-2017: added the module to the modules directory
       
    • By netcarver
      Part 1 of a 2 part Module & Service Reveal.
      I'm currently working on a new module: ModuleReleaseNotes that was inspired by the work I originally did on making Ryan's ProcessWireUpgrades module "release" aware. In the end, I decided to ditch the approach I was originally taking and instead work on a module that hooked in to the UpgradeConfirmation dialog and the module edit page.
      Aims
      My aims for this module are as follows...
      Make discovery of a module's changes prior to an upgrade a trivial task. Make breaking changes very obvious. Make reading of a module's support documentation post-install a trivial task. Make module authors start to think about how they can improve the change discovery process for their modules. Make sure the display of information from the module support files/commit messages doesn't introduce a vulnerability. Looking at these in turn...
      Making discovery of a module's changes prior to upgrade a trivial task.
      This is done by adding a "What's changed section" to the upgrade confirmation dialog.  This section takes a best-effort approach to showing what's changed between the installed version and the updated version that's available via the module repository.
      At present, it is only able to talk to github-hosted repositories in order to ask them for the release notes, the changelog file (if present) and a list of commits between the git tag that matches the installed version and the tag matching the latest version.
      It will display the Release Notes (if the author is using the feature), else it will display the commits between the tags (if tagging is used by the module author) else it will show the changelog file (if present) else it will show the latest N commits on the master branch (N, of course, being configurable to your liking.)
      An example of the Github Release Notes pulled in for you, taken from Mike Rockett's TextformatterTypographer Module...

      An example of a tag-to-tag commit list from the same module...

      An example of a changelog - formatted to show just the changes (formatting styles will change)...

      Finally, an example of a fallback list of commits - sorry Adrian ...

       
      Making breaking changes obvious.
      This is currently done by searching for a set of configurable search strings. Later versions may be able to support breaking change detection via use of Semantic Versioning - but this may require some way of signalling the use of this versioning standard on a module-by-module basis.
      For now, then, you can customise the default set of change markers. Here I have added my own alias to the list of breaking change markers and the changes section of the changelog is styled accordingly (these will be improved)...

       
      Make reading of a module's support documentation, post-install, a trivial task.
      This is done by making some of the support files (like the README, CHANGELOG and LICENSE files) readable from the module's information/settings screen. There is an option to control the initial open/closed state of this section...

      Here is Tracy's README file from within the module settings page... 

       
      Make module authors start to think about how they can improve the change discovery process for their modules.
      There are notes in each of the sections displayed on the upgrade confirmation page that help authors use each of the features...

       
      Make sure display of external information doesn't introduce a vulnerability.
      This is an ongoing concern, and is the thing that is most likely to delay or prevent this module's release lead to this module's withdrawl should a vulnerability be found. Currently, output is formatted either via Markdown + HTML Purifier (if it was originally a Markdown file) or via htmlspecialchars() if it has come from a plaintext file.
      If you discover a vulnerability, please get in contact with me via the forum PM system.
       
      Ongoing...
      For now, I've concentrated on integration with GitHub, as most people use that platform to host their code. I know a few people are hosting their repositories with BitBucket (PWFoo comes to mind) and some with GitLab (Mike Rockett?) and I would eventually like to have adaptor implementations for these providers (and perhaps GitKraken) - but for now, GitHub rules and the other hosts are unsupported.
       
      Links
      Github: ModuleReleaseNotes
      PW Module Repository: Here
    • By FrancisChung
      Hi,
      I was wondering if anyone knew what this did? 

      If so, do you know what modules it actually impacts? Is there another log that lists the action it took?

      I'm having some weird problems with PHP duplicate declaration per link below, since this module was run.
       
       
    • By tpr
      AdminOnSteroids
      Various admin tweaks to enhance ProcessWire admin.
      http://modules.processwire.com/modules/admin-on-steroids/
      https://github.com/rolandtoth/AdminOnSteroids