-
Posts
10,902 -
Joined
-
Last visited
-
Days Won
349
Everything posted by adrian
-
Selector arrays with page reference fields with AND, not OR
adrian replied to adrian's topic in API & Templates
Ok, I ended up looking into it and from what I can tell the only way is to use the "regular arrays" option, rather than the associative approach. This seems to work: foreach($input->get->amenities as $amenity) { $selector[] = ['amenities.title', $amenity]; } It gets converted to: and the final selector ends up having this, which is what I need. amenities.title=Kitchen, amenities.title=Laundry Maybe this is the only way, but if anyone else has another solution, let me know. Otherwise, hope this helps someone else down the road, -
Selector arrays with page reference fields with AND, not OR
adrian replied to adrian's topic in API & Templates
What I am looking for is pages that have the amenities page field with Kitchen & Laundry selected, not either, hence the AND, not OR. Maybe my idea at the end doesn't make sense, but I am still looking to use the selector array to end up with the: amenities.title=Kitchen, amenities.title=Laundry which is logical. Maybe it's not possible and I need to build up a selector string like I always have? -
Selector arrays with page reference fields with AND, not OR
adrian posted a topic in API & Templates
Hi everyone, In a rush and using selector arrays for the first time and hoping someone can point me to an easy way to convert a mult-value page reference field into an AND selector. This: is getting converted into: "parent=1031, start=1, limit=6, sort=title, category=1111, amenities.title=Kitchen|Laundry, status<1024" but of course I want: "parent=1031, start=1, limit=6, sort=title, category=1111, amenities.title=Kitchen, amenities.title=Laundry, status<1024" with each selected "amenities" option expanded out so it's AND and not OR. Anyone done this with selector array? A little OT, and I probably need to look over some history here as to why it's not available, but sometimes I think it would be nice if we could just do: amenities.title=Kitchen&Laundry Thanks for any help! -
-
how to transform page selectors into sql queries?
adrian replied to bernhard's topic in General Support
I know you know about this now @bernhard but others may not and since I just stumbled across this post, I thought I post this which shows running a $pages->find in the console panel and then viewing the resulting SQL Query in the "Selector Queries" section of the Debug Mode panel (from the ajax bar). Hope that helps others who come across this thread. -
Hey @tpr - thanks for your work on this - I think it's a great addition. Not sure why, but I had to change max-height for the rolled up version from 39px to 47px, otherwise I got a scrollbar in the header. Does it look OK for you with this change (just committed). I moved the js into main.js (which is new) as a place to load all general JS (that doesn't need injected PHP vars). The last version also includes some z-index fixes (introduced recently in the Tracy core), your sticky table header, and I added the fullscreen/halfscreen button to a couple of other panels that I thought could benefit from it. Also added @gmclelland's idea of linking to fullsize version of image. In the PW admin this opens in a modal, but just same page in frontend. Thanks again!
-
Sure, I'll add to the next version. Sounds like a good idea - thanks! I think this looks awesome actually. I was kinda looking for something along these lines, but never really figured out the best approach. I went with the ESC to close all panels, but then there was no way to restore. I was going to add a Tab key option to work like tool panels in Adobe products, but you can't really make use of the tab key like that because it's needed for so many other things. I think what you have here looks like a great option for quickly getting a panel out of the way without closing it. Would appreciate some code whenever you get around to it - thanks!
-
@gmclelland - I think you're issues should be fixed in the latest version (thanks for PM help with this). @bernhard - I have modified the behavior of the large/small buttons in the Console panel to be fullscreen/halfscreen. Please take a look and let me know if you think that behavior suits your needs. I am ok with adding it to other panels as well if you think it works well, although obviously some panels would look pretty silly fullscreen As for the z-index issues - I think that's maybe an AOS conflict - @tpr was working on that yesterday. Please let me know if they persist with AOS disabled. Everyone else - while fixing the issue that @gmclelland was having, I make quite a few changes to the the Field List & Values section of the Request Info panel. It should now generally be even lighter and yet also show more depth of details. It also now shows unformatted and formatted values for each field. There is also a new Image Details column - displaying the thumbnails is optional (check config settings - you may want to disable if you have image fields with lots of images). Please let me know if you have any issues with the new version or ideas for improvements.
-
how to create non editable field to show page ID in admin form?
adrian replied to neosin's topic in Getting Started
insertBefore or prepend https://processwire.com/api/ref/wirearray/insert-before/ https://processwire.com/api/ref/wirearray/prepend/ -
how to create non editable field to show page ID in admin form?
adrian replied to neosin's topic in Getting Started
This will let you do what you want: http://modules.processwire.com/modules/fieldtype-runtime-markup/ -
Yeah - I don't think init.php and ready.php existed when I wrote this. I guess the only advantage to admin.php is that it is only called in the backend, whereas init.php and ready.php are called in frontend as well. It won't make any significant impact on performance though, so whatever works for you.
-
[Solved] Profields page table auto add chidlren?
adrian replied to neosin's topic in General Support
You could put it in your admin.php as I mentioned in that thread, or your ready.php if you prefer. -
Hi @gmclelland - sorry about that - I tried to cleanup that code a few versions ago - looks like you've come across something I haven't accounted for. I am trying to replicate here, but no luck so far. I feel like it might be related to the File/Image Details > Formatted Value setting, but no luck yet. Could you perhaps send me a json export of the field in question and let me know if there are any files/images uploaded to it, and anything else that might be relevant please?
-
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?
-
[Solved] Profields page table auto add chidlren?
adrian replied to neosin's topic in General Support
Cheers - check that issue that @thetuningspoon brought up a couple of posts below - might be something to change in my code - I don't think I ever looked into it. -
[Solved] Profields page table auto add chidlren?
adrian replied to neosin's topic in General Support
-
His next post was definitely spam - links to shady site - he's blocked as a spammer now!
-
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.
-
Thanks @Juergen - I don't really understand why you are getting those results for $file - I can't reproduce, but maybe you could just test this for me: Replace this: foreach($repeater->{$rf->name} as $file) { $files[$file->name] = $repeater->id.'|'.$rf->id; // add filename with respective repeater pageid and fieldid to array } with: foreach($repeater->{$rf->name} as $file) { if(!$file) continue; $files[$file->name] = $repeater->id.'|'.$rf->id; // add filename with respective repeater pageid and fieldid to array } Check that the notice is gone and that everything still works as expected. Thanks!
-
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
-
Hey @bernhard - totally OT, but any ideas why the full Tracy bar is showing twice in your screenshot?
-
Just done - thanks.
-
Just do a bd() call on each of those variables just before that line - one of them will likely return null.
-
Sorry @flydev - I don't quite follow what you are saying there, but to clarify what I am seeing - once it hit's 10 packages for one site, none are deleted, so no more are uploaded unless I manually delete some.
-
Thanks @Juergen - late here, so will look at better in the morning, but could you please check if it's $file, $repeater, or $rf that is triggering that? I am assuming you either have no files uploaded to that field, or no items in the repeater yet. Thanks!