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 kixe
      Email Verification
      This module provides functions to validate email adresses and hosts. The module generates a textfile for blacklisted mailhosts (trashmail), which will be always up to date.
      Download
      https://modules.processwire.com/modules/email-verification/
      API
      // get module $mailcheck = $modules->get('EmailVerification'); // return bool/ string - automatted update of blacklist file $mailcheck->blacklisted(email|domain) // return bool - validate a top level domain, checks against IANA list $mailcheck->validTLD(tld) // return array of punycoded TLDs - cyclic updated, data pulled from IANA $mailcheck->getTLDs(cycle=2592000) // return bool - checks syntax converts to punycode $mailcheck->validDomainName(domain); // return bool - checks punycode encoded syntax $mailcheck->validHostName(host); // return bool - checks syntax and accessibility $mailcheck->validHost(email|domain) // add a single value to blacklist $mailcheck->addToBlacklist(email|domain) USAGE
      $mailcheck = $modules->get('EmailCheck'); $email = 'susi@trashmail.com'; if($mailcheck->blacklisted($email)) echo 'Email Provider not allowed'; if(!$mailcheck->validHost($email)) echo 'Mailhost not available'; Example blacklist file:  blacklist.txt
       
    • By teppo
      Code Blocks Textformatter is a tiny Textformatter module I cooked up to add support for code blocks to text/textarea/RTE fields on some of the sites I work with. Unlike a full-blown Markdown Textformatter – which is something that we already have in the core – this module simply adds support for fenced and inline code blocks.
      The syntax is based on the GitHub code block documentation, so please refer to that for additional instructions. The README at GitHub also includes some basic examples. As with any Textformatter, in order to enable this one, install it and enable it via field settings. Note that there's no syntax highlighting built in (at least for the time being), so use a tool of your choice for that – personally I prefer Prism.js.
      Since this module doesn't use a Markdown tool behind the scenes, but rather some home baked regular expressions, there's always the possibility that I've missed something – but please let me know if you use this module and run into any issues. On the other hand this module should be relatively fast and unobtrusive, as there are no unnecessary bits of code to run 
      GitHub repository: https://github.com/teppokoivula/TextformatterCodeBlocks Modules directory: http://modules.processwire.com/modules/textformatter-code-blocks/
    • By theo
      Here is my first processwire module (beta).
      https://github.com/theo222/ImagePickerField
      A lot of "first times". First time Github, Markdown and of course PW Modules.
      So be gentle please.
      I hope it works.

    • By horst
      Image Animated GIF  v 2.0.2
       
      Module for PW 2.5 stable or newer, but is obsolete for PW Versions greater then 3.0.89 (... read more ...)
       
      This module helps with resizing and cropping of animated GIFs when using the GD-Library.
      The GD-Library does not support this.


      This module is completely based upon the fantastic work of

         László Zsidi (http://www.gifs.hu/, builts the initial classes)
         xurei (https://github.com/xurei/GIFDecoder_optimized, enhanced the classes)


      I have ported it to a PW module and it works with core imagefields, together with Pia and with CropImagefields that uses the new naming scheme since PW 2.5.
       
      ------------------------------------------------------------------------------------------------------------------------------------------
      read more in this post about the rewrite from version 1.0.0 to version 2.0.0
      ------------------------------------------------------------------------------------------------------------------------------------------
      You can find it in the modules directory: https://modules.processwire.com/modules/image-animated-gif/
      and on Github: https://github.com/horst-n/ImageAnimatedGif
      ------
      A preview can be found here