Jump to content

Zeka

Members
  • Posts

    1,065
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zeka

  1. https://processwire.com/api/ref/sanitizer/match/
  2. @MarcoPLY So they don't show even after you click 'Find pages to translate'?
  3. Hi @a-ok Take a look at this part of 3.0.87 blog post https://processwire.com/blog/posts/pw-3.0.87/#new-field-template-context-settings
  4. As @Macrura said in most cases ProCache and WireCache is the way to go for me. Also what I have found super useful is namespaces for WireCache, as for the example you can load all cache for a page with namespaced cache and preloadFor method just with one query. There is CacheNesting module, I haven't used it but it should help to handle such scenarios https://modules.processwire.com/modules/cache-nesting/.
  5. Hi. I have CKEditor field with the name 'wysiwyg' In config.js and config-wysiwyg.js I have such code CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: config.language = 'ru'; // config.uiColor = '#AADC6E'; }; File config-wysiwyg.js get loaded on the page edit screen, but the language is not changed. But if I put 'language:ru' to 'Custom Config Options' on the field edit page everything works as expected. What is strange, that is if I try to change UI color via config-wysiwyg.js - color get changed. CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: config.language = 'ru'; config.uiColor = '#AADC6E'; }; So it looks live there is some special case with language property. Did somebody have such behavior? I want to have all field-relative settings in the one file to not get a mess.
  6. Ryan, thanks for the update. It would be great to get an update of "Selectors as regular and associative arrays".
  7. @David Karich Great module. Just curious is it possible to sort pages by page views?
  8. I think that Functional API quite convenient, maybe we can introduce two code boxes with examples without and with Functional API with notice that it doesn't work out of the box and require some modification of config.php and add a link to the blog post or documentation page.
  9. @manlio Have you deleted repeater fields with same names?
  10. Just a note about fonts. Maybe we should consider fonts with the Cyrillic glyphs support? In the longer term, there probably maybe some messages on the forum or even parts of documentation translation in Ukrainian or Russian languages. Without Cyrillic glyphs, this parts will fallback to another font and it will look not consistent with other parts.
  11. $this->addHookAfter('ProcessTemplate::buildEditForm', function ($event) { $form = $event->return; $template = $event->arguments[0]; $icon_field = $form->find('name=pageLabelIcon')->first(); $icon_field->collapsed = Inputfield::collapsedHidden; $field = $this->modules->get('InputfieldText'); $field->attr('id+name', 'template_emoji'); $field->icon = 'list-ol'; $field->attr('value', $template->template_emoji); $field->columnWidth = 100; $form->insertAfter($field, $icon_field); $event->return = $form; }); $this->addHookBefore('ProcessTemplate::executeSave', function ($event) { $template = $this->templates->get($this->input->post->id); $template->set('template_emoji', $this->input->post->template_emoji); }); $this->addHookAfter('ProcessPageListRender::getPageLabel', function ($event) { $page = $event->arguments('page'); $template = $page->template; if($template->template_emoji) { $event->return = $template->template_emoji . ' ' . $event->return; } });
  12. @BFD Calendar You got Fatal error: Uncaught Error: Call to a member function each() on null in So you have to make sure that the is workshops_list is populated and contains an iterable object that extended from WireArray, so you can use each method on it. if(count($item->workshops_list)) { $out .= $item->workshops_list->each( "<font color='green'>| {title}</font>" ); }
  13. @ren Great tutorial, thanks.
  14. I this test case 'truncate' method also removes paragraph tags. I have tried different combinations of 'keepTags' and 'keepFormatTags' without luck.
  15. @Michkael Flexbox (css), https://github.com/liabru/jquery-match-height (javascript).
  16. @SwimToWin There RecureMe module for managing of recuring dates
  17. Hi. Is it possile to use Inputimagefield on a process module page? $f = $this->wire('modules')->get('InputfieldImage'); $f->setAttribute('name', 'image'); $f->label = $this->_('Image'); $f->columnWidth = 75; $markup->add($f); This code renders field but it obviously doesn't work) I have read somewhere on the forum that this input type intended to work in the context of page edit, so it's not possible to use it on a module config page, but process page is actually a page, so I thought there is might be the way how to get it working. Thanks, Eugene.
  18. Hi. I have a hook to Pages::saveReady that changes page name and I get warning like Changed page URL name to "doc-1103" because requested name was already taken. or Warning, the name you selected "dokument" has been changed to "doc-1104". I think that I have the same case like there https://github.com/processwire/processwire-issues/issues/648 Is it possible to somehow silence this warning? Thanks.
  19. Hi. I got this error when trying to access Parent properties in Custom find (Selector field) white configure page reference field I'm on a clean installation of PW 3.0.122 and PHP 7.2.4 Please confirm.
  20. Do you have the same issue? https://stackoverflow.com/questions/22964411/google-tag-manager-include-that-passes-mod-security-rules-in-apache
  21. @Laikmosh I'm not sure, but I think that there is no difference in performance between $pages, wire('pages) and pages(). There is also a third way to access API variables - functions API https://processwire.com/blog/posts/processwire-3.0.39-core-updates/#new-functions-api
  22. Here is the description of Pageimages class ProcessWire Pageimages Pageimages are a collection of Pageimage objects. Typically a Pageimages object will be associated with a specific field attached to a Page. There may be multiple instances of Pageimages attached to a given Page (depending on what fields are in it's fieldgroup). https://processwire.com/apigen/class-Pageimages.html
  23. @kongondo As for me it should be changed to setArray as in current implementation WireArray() looks like an alias (in most scenarios) for WireArray->import and not new WireArray().
  24. No, it behaves in that way when different 'keys' have the same values. One more example $array = WireArray([ 'test' => 'test1', 'test1' => 'test1', 'test2' => 'test2' ]); d($array); count => 2 items => array (2) - test => "test1" (5) - test2 => "test2" (5) Actually, I think that it's a bug in WireArray() function as if use new WireArray() it works as expected $test = [ 'test' => 'test1', 'test1' => 'test1', 'test2' => 'test2' ]; $array = new WireArray(); $array->setArray($test); d($array); count => 3 items => array (3) - test => "test1" (5) - test1 => "test1" (5) - test2 => "test2" (5) Here is code for WireArray(); public static function newInstance($items = null, $class = '') { if(empty($class)) $class = get_called_class(); /** @var WireArray $a */ $a = new $class(); if($items instanceof WireArray) { $items->wire($a); $a->import($items); } else if(is_array($items)) { $a->import($items); } else if($items !== null) { $a->add($items); } return $a; } So the issue is in the usage of import method as it skips any items already present in WireArray.
  25. $insert = new Event(5555); if($s->count() > 5) { $s->insertAfter($insert, $s->eq(5); }
×
×
  • Create New...