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

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 Macrura
      This is a new module, hope to release soon, which allows extended field descriptions, in currently 2 ways.
      The main feature of the module is that you can have a short description and then a 'more...' link which drops down a longer block of text.
      This is achieved by separating the intro/visible text and the rest with 5 dashes.

      Example setup:

      the 2nd way is if you are using AdminThemeUiKit, you can show extended field instructions in a panel. The content of the panel is edited on a regular PW page. This use case would probably not be that common, but if you had a field that required some extended instructions for how to use, this could be useful; Also, since this allows you to target information and instructions down at the field level, it could reduce the amount of documentation needed on a global level, since it is a lot more context targeted.

    • 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. 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.
       
      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.
      I hope to have this ready for general release within the next week.
    • By blynx
      Hej,
      A module which helps including Photoswipe and brings some modules for rendering gallery markup. Feedback highly appreciated

      Modules directory: http://modules.processwire.com/modules/markup-processwire-photoswipe
      .zip download: https://github.com/blynx/MarkupProcesswirePhotoswipe/archive/master.zip
      You can add a photoswipe enabled thumbnail gallery / lightbox to your site like this. Just pass an image field to the renderGallery method:
      <?php $pwpswp = $modules->get('Pwpswp'); echo $pwpswp->renderGallery($page->nicePictures); Options are provided like so:
      <?php $galleryOptions = [ 'imageResizerOptions' => [ 'size' => '500x500' 'quality' => 70, 'upscaling' => false, 'cropping' => false ], 'loresResizerOptions' => [ 'size' => '500x500' 'quality' => 20, 'upscaling' => false, 'cropping' => false ], 'pswpOptions' => (object) [ 'shareEl' => false, 'indexIndicatorSep' => ' von ', 'closeOnScroll' => false ] ]; echo $pswp->renderGallery($page->images, $galleryOptions); More info about all that is in the readme: https://github.com/blynx/MarkupProcesswirePhotoswipe
      What do you think? Any ideas, bugs, critique, requests?
      cheers
      Steffen
    • By mtwebit
      Tasker is a module to handle and execute long-running jobs in Processwire. It provides a simple API  to create tasks (stored as PW pages), to set and query their state (Active, Waiting, Suspended etc.), and to execute them via Cron, LazyCron or HTTP calls.
      Creating a task
      $task = wire('modules')->Tasker->createTask($class, $method, $page, 'Task title', $arguments); where $class and $method specify the function that performs the job, $page is the task's parent page and $arguments provide optional configuration for the task.
      Executing a task
      You need to activate a task first
      wire('modules')->Tasker->activateTask($task); then Tasker will automatically execute it using one of its schedulers: Unix cron, LazyCron or TaskerAdmin's REST API + JS client.
      Getting the job done
      Your method that performs the task looks like
      public function longTask($page, &$taskData, $params) { ... } where $taskData is a persistent storage and $params are run-time options for the task.
      Monitoring progress, management
      The TaskerAdmin module provides a Javascript-based front-end to list tasks, to change their state and to monitor their progress (using a JQuery progressbar and a debug log area). It also allows the on-line execution of tasks using periodic HTTP calls performed by Javascript.

       
      Monitoring task progress (and log messages if debug mode is active)

       
      Task data and log

      Detailed info (setup, task dependencies, time limits, REST API etc.) and examples can be found on GitHub.
      This is my first public PW module. I'm sure it needs improvement
       
    • By netcarver
      A very simple textformatter that was inspired by Diogo's RemoveHeight textformatter.
      This one strips the height from any images and either adds a custom class or adds a max-width:100% as an embedded style.
      Github: https://github.com/netcarver/TextformatterFluidImages
      PW Repo: To Be Confirmed.