Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Zeka last won the day on November 26 2019

Zeka had the most liked content!

Community Reputation

970 Excellent

About Zeka

  • Rank
    Hero Member
  • Birthday 04/12/1989

Profile Information

  • Gender
  • Location
    Kiev, Ukraine

Recent Profile Visitors

3,424 profile views
  1. @Bike Maybe you can hook to Page::path, allow URL segments on your '/book/' page and use the example code from there thread
  2. Hi @Clément Lambelet I haven't tried to hook to ProcessWire::init within module's init method, but probably it's too late to declare hook for init method as modules initialization method is triggered within this method, have you tried to add your hooks in initBefore.php or boot.php? ( You can create these additional status files within 'site' directory and set them in your config file). https://github.com/processwire/processwire/blob/master/wire/config.php#L1559
  3. I have several almost the same cases. We are running several news sites where every news item page have an image and this image at least have two variations, one for the intro (390x240) and second for full article view, so I would like to set admin thumbs to 390x240 and with specific quality settings, so we could reuse this variation on frontend. In this scenario with the current amount of pages, we can save up to ~7GB of storage space. @gebeer Could you please open an issue in feature-requests repo?
  4. $this->wire()->addHookBefore('ProcessPageAdd::execute', function($event) { $object = $event->object; $allowedTemplates = WireArray($object->getAllowedTemplates($this->pages($this->input->get('parent_id')))); if($allowedTemplates->has('basic-page')) { $this->wire()->addHookBefore('InputfieldSelect::render', function($event) { $event->object->set('defaultValue', $this->wire('templates')->get('basic-page')->id); }); } }); EDIT: this code worded for some pages, but not for other. So, probably buggy solution.
  5. @fruid Have you tried to hook ProcessPageAdd::executeTemplate or ProcessPageAdd::buildForm?
  6. Hi @tires Probably you can hook Page::moveable public function init() { $this->addHookAfter('Page::moveable', $this, 'moveable'); } public function moveable($event) { $page = $event->object; if ($page->template->name == 'test') { $event->return = true; } }
  7. @David Karich Not sure, but probably it's more right to use 'return' instead 'exit()' across 'trackPageView' so we still get 404 page. Currently, I'm getting a blank page with 200 code when I directly access any page with prepended 'phcv1' segment with a template that added wether to API or automatic tracking templates list.
  8. Hi @Violet The issue is that you set start as 0 on every page. Thake a look at this thread
  9. @joe_g Perhaps you not fully understand how image fild works in PW. You can upload an image to image field at than use API for getting needed sizes and variations. https://processwire.com/docs/fields/images/
  10. Hi @joe_g Are you talking about images in the image field?
  11. There is also additional options for field rendering https://processwire.com/blog/posts/more-repeaters-repeater-matrix-and-new-field-rendering/ https://processwire.com/blog/posts/processwire-3.0.7-expands-field-rendering-page-path-history-and-more/#field-rendering-with-template-files
  12. Hi @ryan and thank you for such great and in my case in-time update. A couple of questions: Do these codes do the same thing or they differ internally? $items = $pages->find("title|body*=$q, field=title|summary"); and $items = $pages->find("title|body*=$q, [ 'loadOptions' => [ 'joinFields' => [ 'title', 'summary' ] ] ]"); ---------------------------------- I remember that there were some issues with autojoining of multi-value fields with 'loadOptions' option in find method (like page reference or options fields etc). Are there any changes? ---------------------------------- I have found that if I specify a field that does not exist "findRaw" method starts to join default page properties: And without ---------------------------------- What is the right way to handle the situation when we need to autojoin some fields only for the current page. For example, SEO fields in most cases used only on the page object of the current page, but if I set these fields autojoin then than they will be autojoined on every find call, so then we have to specify that we don't want to join these fields in 'joinField' options or via newly added options that also is not very handy. I was trying to set autojoin flag for these field in init.php and remove it in ready.php like // init.php fields('seo_title')->addFlag(Field::flagAutojoin); fields('seo_description')->addFlag(Field::flagAutojoin); fields('seo_og_title')->addFlag(Field::flagAutojoin); fields('seo_og_description')->addFlag(Field::flagAutojoin); //ready.php fields('seo_title')->removeFlag(Field::flagAutojoin); fields('seo_description')->removeFlag(Field::flagAutojoin); fields('seo_og_title')->removeFlag(Field::flagAutojoin); fields('seo_og_description')->removeFlag(Field::flagAutojoin); But in this case, there is no way to check does current template have these fields as on the "init" state template and page variables are not available, so all templates have to have these fields or we will get an error. Maybe there is something already that can help?
  13. For some projects I'm using business hosting from one of the best hoster in Urkaine https://www.ukraine.com.ua/en/business-hosting/. They have one of the most feature-rich control panel that I have ever seen. There is an option to locate your account in a German data centre. So I would recommend it to try.
  • Create New...