• Content Count

  • Joined

  • Last visited

  • Days Won


Zeka last won the day on December 11 2018

Zeka had the most liked content!

Community Reputation

695 Excellent

About Zeka

  • Rank
    Hero Member
  • Birthday 04/12/1989

Profile Information

  • Gender
  • Location
    Kiev, Ukraine

Recent Profile Visitors

2,394 profile views
  1. @Robin S No, there are no problems and actually, I use this code, but I would like to have a more obvious way to detect for which page the hook was triggered. $page instanceof RepeaterPage or $page->template != "repeater_template"
  2. Hi. I have a hook to ProcessPageEdit::buildForm where I add a custom tab. wire()->addHookAfter('ProcessPageEdit::buildForm', function ($event) { $page = $event->object->getPage(); if ($page->template == "news-item" || $page->template == 'organization-news-item') { //.... $pageEditTab = $form->find('id=ProcessPageEditContent')->first(); $form->insertAfter($inputfields, $pageEditTab); wire()->addHookAfter('ProcessPageEdit::getTabs', function ($event) { $event->return = array_merge( array_slice($event->return, 0, 1, true), array('change_news_parent' => __('Изменить категорию новости')), // should be identical to the weird name/title above array_slice($event->return, 1, null, true) ); }); $event->return = $form; } }); I have repeater field in the template for these pages. The issue is that this hook is also triggered when I add a new item in the repeater field. So the $form becomes the form of repeater page and this part of the code return null $form->find('id=ProcessPageEditContent')->first() and I get the error about the second argument inside insertAfter method. I can add if (!$pageEditTab) return;, but it looks unclear for me how I can limit my code only for 'master' page and not items of repeater field. Thank in advance.
  3. Zeka

    @PhotoWebMax Are you on GD or ImageMagick? Second should produce better results. Also, try to set sharpening to 'soft' which is PW default.
  4. Zeka

    @MateThemes Could you please share your code and the error you are getting? Also, make sure that you are not passing a menu name or title as the first argument of the render method. In ML setup it should be id, an array of menu items or page object.
  5. Zeka

    @Moebius Try to set useLanguages property to true. $field->useLanguages = true;
  6. Zeka

    @MarkE Hi. I think that it's should be possible to add additional buttons with needed data attributes with a hook to ProcessPageEdit::buildForm. There you can see different options for data attributes https://github.com/processwire/processwire/blob/master/wire/modules/Jquery/JqueryUI/modal.js#L18
  7. Zeka

  8. @MarcoPLY So they don't show even after you click 'Find pages to translate'?
  9. 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
  10. Zeka

    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/.
  11. 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.
  12. Ryan, thanks for the update. It would be great to get an update of "Selectors as regular and associative arrays".
  13. Zeka

    @David Karich Great module. Just curious is it possible to sort pages by page views?
  14. Zeka

    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.
  15. Zeka

    @manlio Have you deleted repeater fields with same names?