Jump to content

Clarity

Members
  • Posts

    125
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Clarity

  1. Thank you, but can I actually use it in the selector string? I need to find the pages with specific Page Reference and access the first element of them, not simply get the first page of the collection.
  2. Hello everyone! Can you please say how is this situation really possible? 1) On some line of the code inside a class, I assign the value: $this->var = $this->foo(). 2) On the next line of this code, I compare these two and output to TracyDebugger: bd($this->var == $this->foo());, but it outputs false value (first is null and $this->foo() is a set of pages).
  3. Hello everyone! I need to access first element of Page Reference (and generally first element of any collection) field using a selector. Something like $pages->find('page_reference.first=value'). I can't find how to do it in the documentation. Can you please advice me how to do it?
  4. The reason why I was trying to resize SVG is that I need to make repeated set of images sizes of which are independent of sizes which user loads into the field. Anyways, adding width and height attributes resolved my problem. Thank you for the advice!
  5. Hello everyone! I'm trying to resize SVG image using size() function. However, the image appears to be unchanged. I'm using FileValidatorSvgSanitizer module for sanitization of SVGs. What should I do for resizing SVG image if I want to resize them programmatically?
  6. Thanks for the advice, but it doesn't work for me. The error remains the same. My settings/settings.php is like that: <?php $inputfields = array( array( "name" => "emails", "label" => "Emails", "type" => "InputfieldMultiplier", "fieldtypeClass" => "FieldtypeText", "schemaClass" => "FieldtypeText", "qtyMin" => 3, "qtyMax" => 6, "width" => "100", "description" => "", "collapsed" => 0, "placeholder" => "", "columnWidth" => 50 ), array( "name" => "phones", "label" => "Phones", "type" => "InputfieldMultiplier", "fieldtypeClass" => "FieldtypeText", "schemaClass" => "FieldtypeText", "qtyMin" => 3, "qtyMax" => 6, "width" => "100", "description" => "", "collapsed" => 0, "placeholder" => "", "columnWidth" => 50 ) ); return $inputfields; Can you please say what I'm doing wrong?
  7. Thank you about the information! Can you please tell whether it is possible to use ProField: Multiplier for this module? I'm getting an error "ProcessSettingsFactory: Fieldtype is not set".
  8. Hello, @Macrura! Haven't you added the possibility to handle repeaters with this module with updates? I've read at the beginning that it was impossible, but something might change with time.
  9. Hello, @Mats! There is a problem with usage of this field when it is being added inside Repeater. The map does not load when I click to Repeater item since Leaflet's JavaScript is not being initialized after AJAX request. Can you please fix it?
  10. Hello everyone! I have an error "Uncaught ReferenceError: jsMarkupLeafletMap is not defined". My version of ProcessWire is 3.0.199 dev and the version of the module is the latest dev. I found that previously @Marco Angeli resolved the problem here, but it doesn't seem to be my case. Edit: I forgot to add <?php echo $map->getLeafletMapHeaderLines(); ?> to the head. That was my mistake.
  11. Hello everyone! I'm using htmx to send a form to /scan URL, but no "search" parameter is present in "get" in $input variable: <form hx-get="/scan" hx-trigger="submit" hx-target="#result" hx-swap="outerHTML" id="scan-form"> <input type="text" name="search"> <input type="submit"> </form> Can you please tell me where is my mistake?
  12. I found a solution: instead of Wireframe::partial call $this->view->partials->get.
  13. Hello! I need to call Wireframe partial from component's controller method. How can I do it? I see __callStatic method in Wireframe.module.php which seems that may help, but don't know how to apply it.
  14. I got it, thank you! I've thought that it is not a good practice because the title may contain letters on other languages which might cause problems with encoding.
  15. The problem is that I need to use the title, say, 'footer-menu' in code: $menuBuilder->getMenuItems('footer-menu'). Then I think it is not a good practice to give a title to menu like 'Footer Menu'. Also, if the title can be multi-language, it might, I think, cause other issues.
  16. Thank you, finally I found it!
  17. Thank you! Finally, I found the root of the problem. I didn't add "return $inputfields;" to the end of file. I'm not using a namespace explicitly. ProcessWire version is 3.0.199 dev, and everything works fine now.
  18. Hello, @kongondo! Can you please tell me where can I see the name of menu? It seems to me that the name and the title of menu are the same.
  19. Hello, @Macrura! When I use .php file, I get an error: 'Cannot instantiate abstract class ProcessWire\Inputfield'. Can you please tell me how I can overcome this error?
  20. @3fingers, thank you for your answer! Unfortunately, I have a multi-language and the locale should not be hard-coded in site/config.php. Maybe there is a way to define locale from user current settings? I've thought that I somehow need "C" for this purpose.
  21. Hello everyone! I had an error related to "C" locale which told me to translate "C" locale settings. Where can I find this "C" locale in admin for translating it? I can't find it anywhere.
  22. Hello everyone! I have a "Select Options", but I need to illustrate them with images (attach a viewable picture in admin panel to them). How can I do it?
  23. Finally, I found a solution: as @MarkE wrote, I was trying to hook not in proper place. I've hooked another ___processInput method, in InputfieldForm. The working hook is: wire()->addHookBefore('InputfieldForm::processInput', function($event) { $input = $event->arguments('input'); if(!$input->title) { $input->title = '1'; } if(!$input->_pw_page_name) { $input->_pw_page_name = '1'; } }); Thank you all for the advices!
  24. I found that my initial idea of modifying the page is not good. By looking closer into processInput method and exploring what exactly raises the error, I found that the following code does it: /** @var InputfieldPageName $nameField */ $nameField = $form->getChildByName('_pw_page_name'); $name = $nameField->value; if(!strlen($name)) { $nameField->error($this->_("Missing required field: name")); return false; } So the error raises before actual operation with page. I've tried to modify the value of $name via the hook (write "1" to it just to check if it works): wire()->addHookBefore('ProcessPageAdd::processInput', function($event) { $form = $event->arguments('form'); $form->getChildByName('_pw_page_name')->attr('value', '1'); $event->arguments('form', $form); }); Inside the hook the value changes, however, the error still appears. Bar dump of $name inside the code of processInput shows that $name still has zero length. Can you please explain what's wrong and why I can't modify getChildByName()'s value in a hook?
×
×
  • Create New...