Macrura Posted January 17, 2016 Posted January 17, 2016 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/ 21
elabx Posted March 11, 2016 Posted March 11, 2016 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!
Macrura Posted March 12, 2016 Author Posted March 12, 2016 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?
elabx Posted March 12, 2016 Posted March 12, 2016 Hi! I installed directly from Processwire. I was actually talking about this line: https://github.com/outflux3/PrevNextTabs/blob/master/PrevNextTabs.module#L84 My guess is it returns false because if hidden without the "include=all" selector it won't find any pages.
Macrura Posted March 12, 2016 Author Posted March 12, 2016 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! 1
ceberlin Posted August 19, 2016 Posted August 19, 2016 (edited) 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 August 19, 2016 by ceberlin addition 1
Macrura Posted August 20, 2016 Author Posted August 20, 2016 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...) 2
arjen Posted November 3, 2016 Posted November 3, 2016 Just stepping in to say thanks. Great little module with nice UI for a streamlined content editor workflow. 2
evan Posted October 19, 2017 Posted October 19, 2017 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. 3
Macrura Posted October 19, 2017 Author Posted October 19, 2017 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
cstevensjr Posted November 9, 2017 Posted November 9, 2017 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 Reno Admin Theme Default Admin Theme Any help you can provide is greatly appreciated. I have this problem on version 17 and 18 of the AdminUIkit theme.
tpr Posted November 9, 2017 Posted November 9, 2017 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: 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 1
Macrura Posted November 9, 2017 Author Posted November 9, 2017 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... 1 2
cstevensjr Posted November 9, 2017 Posted November 9, 2017 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: 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. 1 1
Macrura Posted November 10, 2017 Author Posted November 10, 2017 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. 2
cstevensjr Posted November 10, 2017 Posted November 10, 2017 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!
Macrura Posted November 10, 2017 Author Posted November 10, 2017 @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..
cstevensjr Posted November 10, 2017 Posted November 10, 2017 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. 1
Macrura Posted November 10, 2017 Author Posted November 10, 2017 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. 2
Macrura Posted November 12, 2017 Author Posted November 12, 2017 @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. 2
tpr Posted November 13, 2017 Posted November 13, 2017 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"). 1
Macrura Posted November 13, 2017 Author Posted November 13, 2017 ok thanks for the alert - i put quotes around it and upped to 009.. 2
Macrura Posted November 14, 2017 Author Posted November 14, 2017 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): so they look like this (using native UiKit classes): the labels go away for smaller screens: also, supports wrap-around pagination for first and last items: 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: 3 1
tpr Posted November 14, 2017 Posted November 14, 2017 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; 1
Macrura Posted November 15, 2017 Author Posted November 15, 2017 @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?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now