Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Clarity

  1. Hello everyone and @kongondo! Can you please tell me how to create a dynamic menu using your module? Where URLs of pages are relative not to a whole site, but to every page where we use this menu.
  2. Hello everyone! Can you please tell me how to save a page after other page becomes hidden? Something like: $wire->addHookAfter('Pages::hide', function($event) { if(wire()->page->id == $event->arguments('page')->id) { wire()->pages->find('selector for page')->save(); } }); But Pages::hide won't work because class Pages doesn't have such a method. Which method of which class should I use?
  3. Hello everyone and @ukyo! Can you please tell me how to deal with this error? Argument 1 passed to ProcessWire\FieldtypeMystique::loadResource() must be of the type string, null given, called in /home/i/ivangr/tverkurort.ru/public_html/site/modules/Mystique/InputfieldMystique.module.php on line 175. My Mystique code is: <?php namespace ProcessWire; return function ($page = null, $field = null, $value = null) { ... };
  4. Hello everyone! Can you please tell me how to exclude hidden repeater fields via API? E.g. something like $page->repeater->find('exclude=hidden').
  5. If I'll really need PageReference, I think I can use hook + JS which was mentioned in the topic above. However, I found that using PageReference for my needs is superfluous, I can simply use ->find() method instead.
  6. I found a solution: increased numPageLinks from 5 to 10.
  7. Hello everyone! I have an issue with MarkupPagerNav module. When I have 6 pages and stay on pages 1-4, the separatorItemLabel is being shown between 5 and 6 while it shouldn't. My options are following: $options = array( 'numPageLinks' => 5, 'nextItemLabel' => '>>', 'nextItemClass' => '', 'previousItemLabel' => '<<', 'previousItemClass' => '', 'lastItemClass' => '', 'currentItemClass' => 'active', 'separatorItemLabel' => '<span>&hellip;</span>', 'separatorItemClass' => '', 'listMarkup' => "<ul>{out}</ul>", 'itemMarkup' => "<li>{out}</li>", 'linkMarkup' => "<a href='{url}'>{out}</a>", 'currentLinkMarkup' => "<span class='current-page' href='{url}'>{out}</span>" ); Can you please tell me where I am wrong?
  8. Hello everyone! I have a PageReference field and I need to get a selector of resulting PageArray for the purpose of setting the limit of these pages in order to use it in the pagination. Can you please give me an advice?
  9. Hello everyone! I have a HTML code for the form: <form class="contact-form" action="/ajax-handler/" method="POST"> <input type="text" placeholder="Name"> <input type="text" placeholder="Phone"> <input type="text" placeholder="Message"> <button type="submit">Submit</button> </form> I have an JS code which handles it via AJAX request: $(function() { var form = $('.contact-form'); $(form).submit(function(e) { e.preventDefault(); var formData = $(form).serialize(); $.ajax({ type: 'POST', url: $(form).attr('action'), data: formData }) .done(function(response) { alert(1); }) }); }); However, when I open "Network" tab in Dev Tools, I see that the request goes to the same page where the form is being placed, not to /ajax-handler/ page. Can you please tell me where I was wrong?
  10. Hello everyone! Can you please tell me how to convert Pageimages collection to plain array?
  11. Yes, it works too. Thank you for the advice. Let me think about it. Thank you about the explanation. 🙂 Thank you for the addition.
  12. Well, my code is like this: <?php namespace Wireframe\Controller; class Test extends \Wireframe\Controller { public function init() { $var = $this->foo(); $this->var = $this->foo(); $this->view->var = $this->foo(); bd($var); // 1 bd($this->var); // null bd($this->view->var); // 1 } public function foo() { return 1; } }
  13. Hello, @AndZyk! Yes, I think it might be the reason. Using $this->view in Wireframe instead of $this resolved my problem.
  14. Thank you, I already found that I can use additional single-valued Page Reference for my purposes.
  15. Sorry if I was unclear, but it's not quite what I want. I need all pages with this Page Reference and with given in the selector value of the first element of this Page Reference, not the first page with this Page Reference.
  16. 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.
  17. 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).
  18. 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?
  19. 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!
  20. 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?
  21. 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?
  • Create New...