Jump to content

taotoo

Members
  • Posts

    68
  • Joined

Everything posted by taotoo

  1. FYI it works fine for me on my Android phone in both Chrome and Stargon (not sure which engine the latter uses).
  2. Maybe you could see if the control panel also displays the output of php.ini somewhere, and see if it matches those values. You could also create a php.ini file, and see if those values match. I might also try uploading files of various sizes around 75mb, have the browser inspector open to see if there's any indication of when it fails, and time the failure point to see if it's something like 30s, or perhaps a multiple of 5 or 7.5 in case it's related to CPU time and the server has a multicore CPU. I have a similar issue when creating variations - I get the endless spinner if the creation takes longer than 15s on a dual core server.
  3. I think "n" is simply an instruction to type the number of results that you would like to have per page in place of it.
  4. I had something similar when using the Title field in a repeater. I'm not sure if it's the same issue or not, but I think I solved it by going to the field's Access tab, turning on access control, and assigning the view permission to guests.
  5. Annoyingly I've just revisited the website and it's no-longer doing it! I'll check it again later. The GPU is a GTX750, and the display is low pixel density, with no scaling involved.
  6. On Chrome (and Firefox) on Win10 I do notice that with the browser window wider than about 1,000 pixels my mouse cursor slows down. The wider the window, the slower it gets. At 2560px wide, the mouse is at about half speed. This is with a modern CPU and also a GPU.
  7. This works great, thank you so much! I noticed that your code is based on a a PW v2.7 Pages.php file. My existing PW v3 Pages.php file had in it only this cloning code: public function ___clone(Page $page, Page $parent = null, $recursive = true, $options = array()) { return $this->editor()->_clone($page, $parent, $recursive, $options); } I just pasted your code in below this, and it works. Not sure if that's what I'm meant to be doing or not. Where does PW v3 keep all its cloning code? I found that I could just add the code below to the hook - it seems to prevent the contents of the field being copied over to the new page: $clone->image = null; $clone->save();
  8. Ah - that's how to do it! I was looking in ProcessPageClone.module and couldn't figure out how the files were being copied... Thank you very much for the comprehensive answer, I'll try it out!
  9. I'm using a hook (similar to @bernhard's below) to add a Clone button when editing pages. Is it possible to clone the page, but without also copying over the image files? I tried adding this code towards the end of the hook: $clone->image = null; $clone->save(); This successfully prevents the contents of the image field being cloned, but PW still copies the image files themselves into the new page's directory. I also looked at the API documentation, but it doesn't seem to provide an option for this. I want to avoid copying the images as there are typically about 20 files that get copied, which takes about 10 seconds on the shared server. Additionally, the first thing the client will do after cloning the page is delete the images as they will be unneeded.
  10. Might you make your module available @Noboru? I'd love to give it a try.
  11. Is it trying to display thousands of pages and timing out? If so maybe an input type such as Page Auto Complete, which doesn't load all of the pages at once might work.
  12. If using server side resize, a webp version of the uploaded image is automatically created (at least if the uploaded image is larger than the field's max dimensions). But when using client side resize this doesn't happen. Is it possible to have a webp version automatically created while using client side resize (without resorting to creating a variation)?
  13. Not that I know of, though maybe it's possible to create a module to do this. You could instead consider using Lister. If you go to Pages > Find, you could save various searches as bookmarks, then add shortcuts to those bookmarks which would be used instead of the Page Tree. You can have different columns for each bookmarked search.
  14. You can add more fields to display by editing the templates for the relevant pages, clicking the Advanced tab, scrolling down to "List of fields to display in the admin Page List", then entering multiple fields such as {title} {a_field} {another_field}. You can also mix in other text, such as {title} | {a_field} > {another_field}.
  15. I use Firefox when debugging srcset as unlike Chrome it doesn't do this!
  16. I find it useful as unlike Direct Output you can define a variable in your page template and then refer to that variable in your header. I only use a single markup definition, and put all of my template code - excluding header and footer - within it.
  17. Is it possible you may be using markup regions? https://processwire.com/docs/front-end/output/markup-regions/ This might explain why it works when you put your code within <div id="content"> ... </div> If you open the _main.php file, can you find the word 'default' in there?
  18. Thank you DaveP! // Otherwise get images of their book covers else: $source = new WireArray(); foreach($page->page_ref_for_their_books as $a_page): $source->add($a_page->images->first); endforeach; endif; echo $source->first->size(100,100)->url;
  19. Further to this, if I use a foreach as above, it works fine: foreach ($source as $source): echo $source->size(100,100)->url; endforeach; But if I use -> first, it doesn't work: echo $source->first->size(100,100)->url; Is this because I've made a PHP array, and it's the case that ->first only works with ProcessWire arrays?
  20. @Macrura@jploch I just updated the module and see that you've fixed it - thank you Macrura! On another note, I'm using Admin Theme Canvas and noticed that it and your module don't play well together, so I amended the FieldDescriptionsExtended.module file like this: Lines 236 and 282: if($this->adminTheme == 'AdminThemeUikit' or $this->adminTheme == 'AdminThemeCanvas') { Line 288: if($this->adminTheme != 'AdminThemeUikit' or $this->adminTheme != 'AdminThemeCanvas') { Not sure if that's the sort of thing you would want to include in the module or not, but will leave it here so that it's findable for others.
  21. If possible I want to have only one section of code for the output, as in reality it's a srcset with lots going on. Though I suppose with your example I could replace the <li> with an include. Otherwise I was wondering if I could build an array, but neither of the two examples below seem to work (the changed lines indicated by asterisks): edit: I had a typo, now it seems both examples below work! // Get images of the author if they exist if $page->images !='': $source = $page->images; // Otherwise get images of their book covers else: foreach($page->page_ref_for_their_books as $a_page): $an_image = $a_page->images->first; * $source[] = $an_image; * endforeach; endif; foreach ($source as $source): echo $source->size(100,100)->url; endforeach; Or: // Get images of the author if they exist if $page->images !='': $source = $page->images; // Otherwise get images of their book covers else: foreach($page->page_ref_for_their_books as $a_page): * $source[] = $a_page->images->first; * endforeach; endif; foreach ($source as $source): echo $source->size(100,100)->url; endforeach;
  22. In my case both scenarios will have multiple images, and I want them to be output with the same img tag, within the same foreach. Maybe I need to change the middle section to something like this. I don't know how to do it though (a wire array maybe?): // Get images of the author if they exist if $page->images !='': $source = $page->images; // Otherwise get images of their book covers else: foreach($page->page_ref_for_their_books as $a_page): $an_image = $a_page->images->first; endforeach; $source = every $an_image merged together to mimic the result of the first condition; endif; foreach ($source as $source): echo $source->size(100,100)->url; endforeach;
  23. The thing is there will be multiple pages in the page reference field, and I want to get the first image from each of them.
  24. I want to display some images. Sometimes the images will be from the current page's image field. But sometimes they will instead be from the image fields of multiple items in a page reference field. I presume in the first case I'm getting an array of images, but for the second I'm getting something else (junk maybe)? // Get images of the author if they exist if $page->images !='': $source = $page->images; // Otherwise get images of their book covers else: $source = $page->page_ref_for_their_books->images->first; endif; foreach $source as $source: echo $source->size(100,100)->url; endforeach;
×
×
  • Create New...