adrian Posted March 31, 2018 Share Posted March 31, 2018 3 hours ago, tpr said: @adrian I've modified field edit links to appear on every page, for non-system fields only, please check. Looks to be great - thank you! 2 Link to comment Share on other sites More sharing options...
adrian Posted April 1, 2018 Share Posted April 1, 2018 Looks like the "Add links to edit previous and next pages" feature results in all sibling pages being loaded - this can be problematic if there are lots of siblings. As soon as I disable that feature it drops down to ~100 pages loaded. Link to comment Share on other sites More sharing options...
adrian Posted April 2, 2018 Share Posted April 2, 2018 Just had a look for the cause of this and it's: $siblings = $this->editedPage->siblings; which of course loads all siblings. I think you'll need to do: $numSiblings = $this->editedPage->parent->numChildren(); or you could separately check if prev and link page ids exist without the siblings check at all. I know you wanted the links to loop back to first when at the end etc, but I think that needs to be a separate page->get() if at end. Does that make sense? 1 Link to comment Share on other sites More sharing options...
tpr Posted April 3, 2018 Author Share Posted April 3, 2018 14 hours ago, adrian said: Does that make sense? Sure, thanks for the help. I've managed to get the first children by using $parent->find('...., limit=1')->first(), so that it doesn't load all pages. For the last child I plan to use $parent->find('..., start=$numSiblings-1, limit=1')->first() which should not load all pages (haven't had the chance to try yet). I think these will be fine but if you know a simpler approach, please tell. 2 Link to comment Share on other sites More sharing options...
adrian Posted April 3, 2018 Share Posted April 3, 2018 4 hours ago, tpr said: Sure, thanks for the help. I've managed to get the first children by using $parent->find('...., limit=1')->first(), so that it doesn't load all pages. For the last child I plan to use $parent->find('..., start=$numSiblings-1, limit=1')->first() which should not load all pages (haven't had the chance to try yet). I think these will be fine but if you know a simpler approach, please tell. How about: $this->editedPage->siblings('sort=-sort, limit=1')->first() Link to comment Share on other sites More sharing options...
tpr Posted April 3, 2018 Author Share Posted April 3, 2018 That would probably work too, will check both later, thanks. Btw "sort" could have been empty before todays update so this I guess would not worked (not sure if sort="-" is valid). Link to comment Share on other sites More sharing options...
Robin S Posted April 3, 2018 Share Posted April 3, 2018 10 hours ago, adrian said: How about: $this->editedPage->siblings('sort=-sort, limit=1')->first() I have a feeling this won't work where a sort setting has been defined on the parent page or template. When that is done the sort property of the child pages does not change, so doing a reverse sort on that property would result in the wrong order. Link to comment Share on other sites More sharing options...
tpr Posted April 3, 2018 Author Share Posted April 3, 2018 Actually @adrian's idea works better, even with template-level sort order too, but only if children are of the same template, or their template sort settings are identical. Link to comment Share on other sites More sharing options...
adrian Posted April 3, 2018 Share Posted April 3, 2018 Would it be easier/more efficient to have << first < prev > next >> last links instead of trying to loop around at the beginning and end? Link to comment Share on other sites More sharing options...
tpr Posted April 3, 2018 Author Share Posted April 3, 2018 That wouldn't solve the template level sort issue when having pages with multiple templates under the same parent. I'm sure the answer lies somewhere in the core but I will leave it there for a while ? Link to comment Share on other sites More sharing options...
Robin S Posted April 3, 2018 Share Posted April 3, 2018 31 minutes ago, tpr said: Actually @adrian's idea works better, even with template-level sort order too, but only if children are of the same template, or their template sort settings are identical. Not sure if that was a reply to my comment, but Adrian's idea isn't working when I test it with sort settings applied to the parent page or template. I think it would have to be something like this: $parent = $this->editedPage->parent; if($parent->id) { $sort = $parent->template->sortfield ?: $parent->sortfield; } else { $sort = 'sort'; } $first = $this->editedPage->siblings("sort=$sort, limit=1")->first(); $last = $this->editedPage->siblings("sort=-$sort, limit=1")->first(); Getting a single page could be simplified with findOne(), but not sure if you care about supporting < PW 3.0.3 scratch that 2 Link to comment Share on other sites More sharing options...
tpr Posted April 3, 2018 Author Share Posted April 3, 2018 Are you sure that the template level sort order is taken from the parent page, and not from children pages? That would make things easier, I'll check tomorrow. Link to comment Share on other sites More sharing options...
adrian Posted April 4, 2018 Share Posted April 4, 2018 Thanks @tpr and @Robin S for your work and thoughts on this. I haven't had time to test thoroughly regarding template level sort etc, but I just wanted to note that the initial issue of loading all siblings is definitely now fixed 1 Link to comment Share on other sites More sharing options...
tpr Posted April 4, 2018 Author Share Posted April 4, 2018 Everything looks fine to me in v1.8.9, thanks everyone for the help. It was new to me that template level sort order takes only the parent page into account, I thought the child pages' templates are also involved somehow. 4 Link to comment Share on other sites More sharing options...
Robin S Posted April 8, 2018 Share Posted April 8, 2018 @tpr, this is a minor thing, but I'm wondering if the magnifying glass icon could be changed perhaps. One thing is that its direction changes in different usages: Another thing (and this is a personal opinion) is that this coloured icon is kinda ugly. It's style is too different to other icons in the UI and it stands out too much. I see that the icon is rendered using Segoe UI Emoji, so maybe the coloured appearance is just a Windows thing? Maybe you could use the Font Awesome version that is bundled with PW (although the magnifying glass icon there is also pretty naff). Or maybe bundle the Material Icons font with AOS? That could be quite handy in general, because then those icons would be available for use in admin UI customisations. Link to comment Share on other sites More sharing options...
adrian Posted April 10, 2018 Share Posted April 10, 2018 Hey @tpr - there is an issue with the z-index when using the fixed/sticky navbar option. Tracy's panels appear under the navbar even though their z-index is higher. Setting the z-index of the navbar to 0 is the only value that puts it behind the Tracy panels. I don't honestly know what the correct solution is, but position:fixed and z-index does seem to have some weird issues. Maybe this is useful? https://developers.google.com/web/updates/2012/09/Stacking-Changes-Coming-to-position-fixed-elements 1 Link to comment Share on other sites More sharing options...
szabesz Posted April 10, 2018 Share Posted April 10, 2018 3 minutes ago, adrian said: Tracy's panels appear under the navbar I can confirm this and there is a similar issue with Lister's "refresh" and "reset" icon buttons, which are also partially covered by the standard "Sticky header" (I never used the Compact option besides testing it once upon a time). 1 Link to comment Share on other sites More sharing options...
adrian Posted April 10, 2018 Share Posted April 10, 2018 While we're on z-index issues, all the AOS config settings sections appear above Tracy panels as well - not a big deal since it's not a common scenario, but just wanted to let you know. Link to comment Share on other sites More sharing options...
tpr Posted April 10, 2018 Author Share Posted April 10, 2018 Thanks, these should be fixed in v1.9.0. @adrian Tracy panels are under one #tracy-debug div so I've added a high z-index to it - I guess nothing needs to be above them. This fix has been there for the individual panels for the Reno theme already though I'm not sure if it was effective. Now it seems to be OK in all the major admin themes. Link to comment Share on other sites More sharing options...
adrian Posted April 10, 2018 Share Posted April 10, 2018 Just now, tpr said: Tracy panels are under one #tracy-debug div so I've added a high z-index to it - I guess nothing needs to be above them. Thanks for trying - not sure about this actually. I actually set Tracy to 100 so that panel appear under PW dropdown menus because it's a pain when a panel is open and you want to navigate in the PW admin. If you don't know of another solution, I think I'd rather see the #tracy-debug z-index left alone because it is configurable in Tracy's settings for a reason. Is that ok? Link to comment Share on other sites More sharing options...
tpr Posted April 10, 2018 Author Share Posted April 10, 2018 I see, forgot about that config setting in Tracy. Setting z-index: 1 for #tracy-debug looks like fixing the issue for the sticky header vs menus in Uikit theme, but I guess that would still spoil the Tracy config setting. Edit: I've removed the #tracy-debug z-index rule, I think the safest is keeping the navbar above all. 1 Link to comment Share on other sites More sharing options...
theo Posted April 10, 2018 Share Posted April 10, 2018 AOS 1.8.9 crashing ProcessWire 3.0.94, when setting Misc->"Add language switcher to the admin". Error Message: Quote Method Page::translator does not exist or is not callable in this context (in /wire/core/Wire.php line 519) I have to remove the item in the database under modules AdminOnSteroids -> data to get PW running again. What could this be? Thank you. Link to comment Share on other sites More sharing options...
tpr Posted April 10, 2018 Author Share Posted April 10, 2018 No problems here on PW 3.97 and 3.98, AOS 1.8.9 and 1.9.0. There was a related PHP warning that was fixed in AOS 1.8.7 but that's below your version. Did you get that error right after saving AOS or happened elsewhere? Link to comment Share on other sites More sharing options...
theo Posted April 10, 2018 Share Posted April 10, 2018 4 minutes ago, tpr said: Did you get that error right after saving AOS or happened elsewhere? Right after. Click "Save" and goodbye. Might be some interaction with other stuff, but I don't know what to look for. Link to comment Share on other sites More sharing options...
tpr Posted April 10, 2018 Author Share Posted April 10, 2018 I guess there's nothing more in the logs that you already wrote. Was it a ML site btw, and if yes, how any languages? Php version? 1 Link to comment Share on other sites More sharing options...
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