-
Posts
10,898 -
Joined
-
Last visited
-
Days Won
348
Everything posted by adrian
-
I freaking love this! It is like the Add mode from BatchChildEditor, but on steroids! I'd be keen to include this as a core action if you're ok with that and you'd like to submit a PR. I can see using this for kickstarting many new sites. If you do want to include, maybe move simple_html_dom.php into the libraries folder under actions, unless you feel like removing this need and coming up with a DOMDocument solution?
-
Another round of tweaks, bug fixes and new features. 1) File Editor revamp to improve layout and adds a new fullscreen editing mode (like the one added to the Console panel), also with the same CTRL + SHFT + Enter shortcut for toggling in and out of that fullscreen. 2) More tweaks and code cleanup for the Console panel. 3) Some nice enhancements and cleanup for the SnippetRunner panel. 4) New "Open" option for the "Goto Page ID" feature in the PW Info panel - this opens the page's branch in the page tree. I find this entire feature very useful when working on sites where the templates make heavy use of IDs instead of paths for querying pages. If you haven't tried, give it a go. ? 5) Various bug fixes in the module and also in the Tracy core. There are quite a lot of changes in this version, so please let me know if you find any issues.
-
[SOLVED] Passing "parent page" to page creation via api
adrian replied to louisstephens's topic in API & Templates
Yeah, go with: $p2->parent = $p so that you are referencing the page. Otherwise you are trying to find a page by name which actually doesn't work like that. -
[SOLVED] Passing "parent page" to page creation via api
adrian replied to louisstephens's topic in API & Templates
Or no quotes at all ? -
@pwired - I could reproduce with Firefox on MacOS and I have pushed a fix in the latest version. Please let me know how it goes at your end. New version also removes the keyboard shortcut text from the top of the Console panel and adds a new toggleable popup info table of all shortcuts:
-
Good to hear - I'll take a look here with Firefox on Mac and see if I can reproduce and fix it.
-
Hey @kongondo - you tempted me to give VSCode another shot and using it now, but it looks like there is some weird matching going on. This popped up when I typed the closing ">" at the end of </div> Any thoughts? Thanks
- 242 replies
-
- 1
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
Nope!
-
Works for me. Can you please check for JS errors in the browser dev console. Any difference in another browser?
-
[Solved] API image upload I need to replace instead of adding
adrian replied to Xonox's topic in API & Templates
Ryan's example using insertAfter works for me - just add in the missing: $page->of(false); line at the top. Did you try that?- 9 replies
-
- image upload
- api
-
(and 1 more)
Tagged with:
-
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.
-
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 ?
-
[Solved] API image upload I need to replace instead of adding
adrian replied to Xonox's topic in API & Templates
https://processwire.com/talk/topic/1470-sort-images-via-api-outside-pw-admin/?do=findComment&comment=19426 Note the mention of the new ->replace() method as well- 9 replies
-
- image upload
- api
-
(and 1 more)
Tagged with:
-
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 ?
- 242 replies
-
- 1
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
[Solved] API image upload I need to replace instead of adding
adrian replied to Xonox's topic in API & Templates
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- 9 replies
-
- 1
-
- image upload
- api
-
(and 1 more)
Tagged with:
-
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:
-
[Solved] API image upload I need to replace instead of adding
adrian replied to Xonox's topic in API & Templates
Just put in a $book->book_images->deleteAll() before the "add" I don't think that replace setting is honored by the API.- 9 replies
-
- image upload
- api
-
(and 1 more)
Tagged with:
-
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.
-
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.
-
Released: Street Address Fieldtype + Inputfield
adrian replied to netcarver's topic in Modules/Plugins
This discussion might also be useful: -
Released: Street Address Fieldtype + Inputfield
adrian replied to netcarver's topic in Modules/Plugins
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. -
@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!
-
Released: Street Address Fieldtype + Inputfield
adrian replied to netcarver's topic in Modules/Plugins
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. -
Released: Street Address Fieldtype + Inputfield
adrian replied to netcarver's topic in Modules/Plugins
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? -
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 ?