Jump to content

adrian

PW-Moderators
  • Posts

    11,206
  • Joined

  • Last visited

  • Days Won

    373

Everything posted by adrian

  1. Ryan's example using insertAfter works for me - just add in the missing: $page->of(false); line at the top. Did you try that?
  2. HI @STA - welcome! There is this module: The other option is to use Tracy's File Editor panel to edit the files directly on the server - the Test mode can make this a pretty decent option.
  3. One more shortcut ? CTRL + SHFT + ENTER will toggle the Console in and out of fullscreen. Totally random, but a little tip about the Console panel - not only is it great for testing the PW API and PHP in general, it's also pretty nice for testing JS code out. Take this example of: calling an external API populating an element in the Console results pane with a property from the returned JSON logging the result to the browser dev console Why use this over the browser console, or CodePen, JSFiddle etc? Well, notice that the API call is grabbing a PW field from the current page: 'https://represent.opennorth.ca/postcodes/<?=$page->postcode?>/' Also, if you are a fan of the output of the Browser dev console, don't forget about Tracy's fl() option to dump objects direct to this. Anyway, hope there is something useful there if you hadn't thought about it before ?
  4. https://processwire.com/talk/topic/1470-sort-images-via-api-outside-pw-admin/?do=findComment&amp;comment=19426 Note the mention of the new ->replace() method as well
  5. I can't imagine how that's possible. You can always do <?php echo $var; ?> anywhere you want. Not saying you shouldn't go with: <?=$var?> but there shouldn't be anywhere you have to use it ?
  6. Yeah, pretty sure you're right. Here's an old discussion about it in case you want to read some of Ryan's thoughts on the matter: https://github.com/ryancramerdesign/ProcessWire/issues/1122
  7. One more quick update. In addition to the existing shortcut keys for toggling the size of the code and results panes in the Console panel, I have added a new one: CTRL + SHFT + → Which resizes the code pane to the height of all the lines of code:
  8. Just put in a $book->book_images->deleteAll() before the "add" I don't think that replace setting is honored by the API.
  9. Ok, I officially hate Safari more than I already thought I did ? I have fixed a whole range of issues I had never noticed previously (mainly because I rarely use it). Detailing here in case they are useful for your development in general. 1) You can't resize panels smaller than their initial size on page load I did however fix the internals of the Console not expanding to match a larger panel if you size larger. The issue is that Webkit browsers will not let you use the CSS "resize" property to resize an element to make it smaller, only larger (in both dimensions): https://css-tricks.com/almanac/properties/r/resize/ Man it took me a long time to figure out why that wasn't working - I thought there was some min-height / min-width type thing going on that was only affecting Safari. Thank goodness Chrome no longer uses the Webkit engine! 2) Safari doesn't play nicely with position: fixed when elements are outside document.body The Tracy core adds its elements to document.documentElement so the only way I could figure around this was to move the Console panel to document.body when clicking the new fullscreen toggle and then back again when restoring to the panel size. This was also really difficult to track down and I never found any reference to this issue online anywhere - fun times ? Because the parent element is changed, I had to change the parent element of several css selectors. I can't find anything broken as a result, but please keep an eye out and let me know if you see anything amiss. 3) Fix missing inner scrollbar in code editor pane This one looks to be a long standing Ace Editor bug, but someone else figured out a simple workaround: https://github.com/ajaxorg/ace/issues/2872 4) Fixed some keyboard shortcut bugs due to missing e.preventDefault() Please let me know if you find any other issues like this Anyway, I think I am done with Safari tweaks for now. I am not sure how many of you are even using it for regular development so I don't want to put too much more time into it, but please do let me know if you find anything I missed.
  10. https://processwire.com/talk/topic/19539-rockgrid-powerful-performant-and-beautiful-data-listing-tool/ Looks like it's only on Gitlab at the moment - not in the modules directory yet.
  11. This discussion might also be useful:
  12. Might save you a little time by taking a look at my changes for the phone field here: https://github.com/adrianbj/FieldtypePhone/commit/bc87e50341f62da6b75de9c79e4ac4574517e49a I think there might be some more changes above, but that's the start of them.
  13. @simonsays - any luck with that change noted in my last post? I think that is probably your issue and I'd like to commit the change if you can confirm it works for you. Thanks!
  14. I have my doubts it will work with FB - I know I had quite a few issues getting my Phone field working. I think in general multivalue fields need some tweaking to work. I eventually got Phone almost totally supported though.
  15. Should be as simple as this: foreach($page->children as $p) { $p->of(false); $p->street_address->recipient = $p->recipient; $p->street_address->organization = $p->organization; $p->street_address->street_address = $p->street_address; $p->street_address->street_address_2 = $p->street_address_2; $p->street_address->street_address_3 = $p->street_address_3; $p->street_address->locality = $p->locality; $p->street_address->dependent_locality = $p->dependent_locality; $p->street_address->admin_area = $p->admin_area; //state, province, etc $p->street_address->postal_code = $p->postal_code; $p->street_address->country_iso = $p->country_iso; $p->save('street_address'); } I would go to the parent page of all your people or businesses or whatever and run that in Tracy's Console panel and you'll be done! Obviously you want to keep the name of the subfield on the left as I have them, but you may need to change the names of the fields on the right side of the "=" Also, in my example, the name of the field in my system is "street_address" - all occurrences of that would need to be changed to match the name of the field you create using this fieldtype. Does that make sense?
  16. Various significant updates today. As per @Robin S's suggestion above, the User Bar Page Versions, User Dev Template and Template Path panel features now support automatic swapping out of the files included via `$config->prependTemplateFile` and `$config->appendTemplateFile` to use the same suffix at the replaced template, eg `_init-dev.php` or `_main-dev.php` if you are on the home page and using a home-dev.php template file replacement. Robin also helped me track down a critical bug that was introduced to Page Versions and User Dev Templates some time ago - thanks for that! If you haven't checked out any of these features in Tracy before, they can be very handy for testing changes (especially on a live site). In particular, giving your clients access to choose from a dropdown of template options can be a very easy way to get their feedback on various options. I have also made several improvements to the new Console panel fullscreen editing experience and also updated the way the results pane scrolls when new items are added. Previously it always scrolled to the bottom of the pane. Now it scrolls to the top of the recently added section, so if you are using Clear & Run, then it will alway be at the top, but if you just Run to add new items, it will scroll down to the top of the new items. Hopefully you'll all find this a nice improvement and will help to reduce your scrolling. I recently noticed some nasty issues with the Console panel in Safari, especially the new fullscreen editing mode, but also when trying to manually resize the panel. Everything looks/works great on Chrome, Firefox, and Opera. I'll take another look and see what I can do about getting Safari to play nicely, but sometimes I feel like Safari is the new IE ?
  17. Hey @Robin S - it didn't, but now it does ? I have also implemented this for the User Bar Page Versions feature and the Template Path panel. These three things do almost the same thing, but for different users in different scenarios. I am going to PM you a copy of this new version to take a look at. I have some other things I am working on and I want to commit altogether.
  18. There are many ways to do this. You could use the API to loop through pages found via a selector, or perhaps you could use the AdminActions module's Page Manipulator action, or if the pages are all under the one parent you could use the BatchChildEditor module.
  19. New version fixes a few bugs in the last release, especially regarding the keyboard shortcuts on Windows. Along these lines, I have also changed the shortcuts for the History Stack - they are now ALT+PageUp and ALT+PageDown. This means there is no longer the need to use the meta key (CMD or WIN key) for this which was conflicting on some systems. If you're on a Macbook without PU and PD keys, just use: fn + ALT + PageUp/Down A big thanks to @Robin S for helping with all the Windows testing on this! I think this is really starting to work really nicely now - I almost want to use it over my code editor ? Anyway, please let me know if you find any issues.
  20. Awesome - thank you!
  21. This basically does the same as kongondo's script, but has a nice GUI if you prefer. This is one the actions in the AdmimActions module.
  22. Yep, there must be more - just backspace until the ; is removed on each line and type it again - that will clear everything up.
  23. @hollyvalero - you have a strange hidden character at the end of this line: $parent = wire('pages')->get("/assessments/"); that is causing the problem - just remove that and it will be fine. I would like to know what BCE was timing out for you and your own script isn't. Usually the easiest option is to up execution and php memory and these scripts will run until completed without any problems.* * yes I should probably build in some chunking to prevent the need to do this for large imports/exports, but I haven't gotten around to it yet ?
  24. The new Console panel fullscreen mode now has keyboard shortcuts to collapse the code or results panes quickly. Here you can see me toggling all code, all results, and the split of both. Shortcuts are: CTRL+SHFT+ Up arrow - collapses code pane Down arrow - collapses results pane Left arrow - to restore split to what it was before you initiated any pane collapses. Hopefully you'll find this a really quick way to get to the view you need.
  25. New version committed that adds a Maximize button to the Console panel as a whole which results in a fullscreen editing and review experience. Thanks to @tpr for his usual tweaks to my styling :) I also added the regular fullscreen/halfscreen buttons to the Dumps and Dumps Recorder panels. These buttons are on several panels where the content can be quite large - they should have been on these panels all the time really. Let me know if you have any issues with any of this - hopefully it should make things easier to work with.
×
×
  • Create New...