Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Clarity

  1. 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.
  2. 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?
  3. I found a solution: instead of Wireframe::partial call $this->view->partials->get.
  4. 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.
  5. 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.
  6. 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.
  7. Thank you, finally I found it!
  8. 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.
  9. 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.
  10. 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?
  11. @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.
  12. 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.
  13. 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?
  14. 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!
  15. 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?
  16. Actually, the page which is not yet created actually has ID = 0, but the path for adding the page is /page/add/ and it doesn't have ID of this page as GET parameter. Thank you, it seems to be right! I shall explore what I can do with this page in more details and report here about the results.
  17. Thank you for the clue! I found the method ___processInput in ProcessPageAdd.module which works before Pages::save, however, it takes $form (likely the form in the editor of page) as an argument instead of $page. It would be nice if it would be possible to extract $this->page from this method.
  18. The error is "Missing required value" on title and name. It is not in error stack, it's just a specific error which follows from requirement of title and name. I want to resolve it by filling transliterated title and name on other languages. However, I don't know the name of the function in which I should hook in order to edit the title well before actual save(). When I hook immediately before save() and try to bd() inside this hook, bd() doesn't work.
  19. Hello everyone! I'm using multi-language site, and if I save the page with title and name only on non-English language, the error appears. I need to hook into some function which applies immediately when I click "Save" so that I can fill the title on English language. Can you please tell the name of this function or give a clue?
  20. In Gmail, for example, you can set "Less secure app access" (Security > Less secure apps) so that WireMailSMTP will be able to access it. Probably it can help.
  21. Hello, @franciccio-ITALIANO! In site/modules/InputfieldCKEditor create the file named config-<your field name>.js and put the following code into it: CKEDITOR.editorConfig = function( config ) { config.enterMode = 2; config.shiftenterMode = 1; };
  22. Hello, @tires! Code 250 OK means that everything went well and your message was delivered to the recipient server. It is possible that privacy settings block receiving of messages.
  23. Hello everyone! I have a text in Textarea and need to underline the first line of it (append class="u-bottom-underline"). By the line I mean the part of Textarea before the first "\n". I've checked the topic: But it's not quite what I need. Thank you in advance!
  24. Hello, @teppo! Can you please tell me whether it is possible or not to use Wireframe's components on templates where it is not initialized? It is needed because some parts of our site work on Wireframe while some aren't, but we need some component that will work across all templates.
  • Create New...