Jump to content

Robin S

Members
  • Posts

    4,928
  • Joined

  • Days Won

    321

Everything posted by Robin S

  1. This is off-topic, but in case anyone else is bothered by the gap/collapse issue... After spending some time seeing if this could be resolved in the JS (conclusion: not easily) I found the simplest solution is to avoid the fractional pixels by setting the menu item padding in whole pixels rather than ems. I added this with AdminCustomFiles: .ui-menu .ui-menu-item a { padding:8px 11px; }
  2. It sounds a little unusual (typically you would use an analytics service to track this kind of stuff) but quite doable. You would do it all in your Search template - I don't think there is any issue regarding GET/POST. You sanitize and check the search terms from $input and if they meet your criteria then send the email and create the page. Then output the search results. It would slow down your search results a bit. If that is a problem you could look at using a queue but I don't know much about that.
  3. @thomas, I created a module that allows image and file fields to be used in inputfield dependencies.
  4. Image & File Dependencies Allows Image and File fields to be used in inputfield dependency selectors. Note: prefix field names with an underscore in your dependency selectors. Usage Install the ImageFileDependencies module. You can now create an inputfield dependency based on the number of images or files added to a Image or File field. When you create an inputfield dependency for a Image or File field, prefix your field name with an underscore. Example for a field named 'images': _images>3 Note that you do not include a '.count' subfield in the selector. https://github.com/Toutouwai/ImageFileDependencies Demo
  5. Output buffering works great with delayed output. Set variable default in your auto-prepended init.php: $sidebar = $page->sidebar; Override in your template as needed: <?php ob_start(); // $sidebar ?> <div class="special-promo"> <h2>My special promo sidebar</h2> <?= $page->special_promo ?> </div> <?php $sidebar = ob_get_clean(); ?> Output in auto-appended main.php: <div class="sidebar"> <?= $sidebar ?> </div> I have never entirely understood the benefit of $files->render(), aka wireRenderFile(). Seems to be similar to an include, but with limited variable scope. Personally I'd rather use includes for shared partials so I can get and set any variable inside the partial without needing to explicitly pass variables back and forth from template to rendered file. I've never had to deal with so many variables that I'm losing track of their names and accidentally overwriting them or anything like that. It is possible to get all fields in a page and loop over them: foreach($page->fields as $field) { $field_content = $page->get($field->name); // output $field_content } But there are few situations where this would be useful, because usually you are using several different types of field on a page which return different types of data (string, WireArray, PageImage, etc) and need different markup output. So most of the time you want to get individual fields by name.
  6. This is working for me (PW 3.0.40)... /site/config.php $config->imageSizes = [ "foo" => ["width" => 200, "height" => 200], "bar" => ["width" => 400, "height" => 0], ]; /site/ready.php $this->addHookAfter('InputfieldFile::fileAdded', function($event) { $inputfield = $event->object; if($inputfield->name != 'images') return; // needs to match the name of your images field // alternatively, to use for all image fields... // if($inputfield->class != 'FieldtypeImage') return; $image = $event->argumentsByName("pagefile"); $sizes = isset($this->config->imageSizes) ? $this->config->imageSizes : []; if(count($sizes)) { foreach($sizes as $size) { $image->size($size["width"], $size["height"]); } } }); You won't see the variations immediately inside PageEdit, but you can see them after you save the page.
  7. It seems you must define the multidimensional array in $config in a single statement: $config->imageSizes = [ "foo" => ["width" => 12, "height" => 34], "bar" => ["width" => 56, "height" => 78], ]; Someone else may know the reason for this.
  8. Unfortunately not. The submenu is positioned absolutely by JS and if I set a translate transform or a negative margin the JS accounts for it and places the submenu further to the right so the result is the same. The first submenu vertical position is okay (no gap), it's the horizontal position of the second nested submenu that's where the gap occurs. Edit: just noticed that the gap appears in Chrome too, so it's probably deliberate. Mousing over the gap doesn't cause the menu to collapse in Chrome but it does in Firefox. Edit2: nope, not deliberate because the gap doesn't appear for every dropdown menu - just randomly.
  9. Issue occurs for me in both Firefox and Chrome. Narrowing it down as you suggested, it seems to be the "FieldAndTemplateEditLinks" submodule that's related.
  10. AOS is preventing the normal rendering of an AsmSelect in the field settings for a RepeaterMatrix field. With AOS disabled the field below renders as an AsmSelect: The AsmTweaks option is not active and there are no errors in the JS console. The AsmSelect becomes operational after the field settings page is saved (the problem occurs when creating a new matrix type).
  11. I went with something relatively tame - a Google image search reveals some truly horrendous pics.
  12. For one site I did this... Created two roles - member and pro-member (pro-member is user with active subscription, with permission to view certain pro-only pages). Added expiry field to user template, as adrian suggested. Users can register for free - they get the basic member role with permission to post comments, limited view permission, etc. If a member purchases a (non-renewing) subscription via PayPal: pro-member role is given to user expiry date is set according the duration they purchased and pro-member role is given to user Daily Lazy Cron job: checks for users with subscription expiring in next three days and emails a reminder to renew subscription removes pro-member role from users with expired subscription
  13. A: They're both big in Germany Not a scientific measure for sure, but for forum members who choose to disclose their location Germany seems to be the most common country. I'm curious about why ProcessWire would be especially popular in Germany. Was PW featured in a popular German-language publication or something like that? For German members (or any members actually): how did you first hear about PW?
  14. Thanks for the tip - will try that for the main menu dropdowns.
  15. This may be caused sub-pixel rounding, creating a 1 pixel or sub-pixel gap between the button and the dropdown. The main menu dropdowns in the default admin theme have a similar issue (in Firefox anyway), causing the menu to collapse as you move to the submenu unless you do it quickly. Looking for a fix for this is on my todo list.
  16. Yep, that's it - removing the rule fixes the issue. The rule is on the html element actually: html.aos.AdminThemeDefault { overflow-y: scroll; }
  17. I tried a few different things trying to get sub-selectors to work in the selector array format and I couldn't get it working either. Maybe someone else will chime in with a tip - otherwise I'd say it is a bug and you should create a GitHub issue for it.
  18. I'm seeing an issue in Firefox where dragging a repeater item causes the item to jump upwards away from the cursor position. Perhaps something to do with offset from the bottom of the viewport, because the issue is particularly noticeable when the browser dev tools panel is open.
  19. Did you try this as a non-array selector and it worked? Just wondering if there could be something in there that stops it working in any form of selector.
  20. Pretty much anything is possible with PW. Make a start by yourself and if you have any specific problems just ask in the forums.
  21. It does work! I tried to use Firelogger back when Tracy Debugger was first released and couldn't get it working. Really glad to be able to use that tool now.
  22. You only need to force a new variation if there is an existing variation that was created with different quality, sharpening or upscaling settings. Once you have got rid of these existing variations you don't need to keep creating new images as that's a waste of server resources. From that point forward PW will serve your variation with the custom quality setting. If you are sure you want all your images with quality 60 then you could set that in config.php. Or if it will vary use the options array when you get the image via the API, as you are doing. If you want to do a one-off clearing of variations site-wide there is a module for that, but note the warning about variations used in RTE fields.
  23. Yeah, but don't leave it in there permanently or you'll be recreating the image over and over again needlessly.
  24. You probably have an existing image variation from before you set a custom quality setting. PW looks to see if there is an existing variation for an image before it creates one. This works well for variations of width and height, but unfortunately the quality, sharpening and upscaling settings are not recorded in the image name so you have to force a new image if you change one of these settings. Some time ago I made a wishlist post about this. You can clear the variations for an image via the admin, or you can temporarily add 'forceNew' => true to your settings array just to create the variation, then remove it. $option1 = array( 'quality' => 60, 'upscaling' => true, 'cropping' => true, 'forceNew' => true, );
×
×
  • Create New...