Jump to content

Zeka

Members
  • Posts

    1,065
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zeka

  1. Hi @adrian I'm using BrowserSync in my dev setup with proxying to test domain. So when I run BrowserSync I can access site through mydomain.test:4000 The issue is that after update 4.21.7 => 4.22.2 of TD module, the TD bar doesn't load when I access site with port number and I get an error in the browser console Uncaught SyntaxError: Unexpected end of input When accessing the site without port TB bar loads normaly. Do you have any idea what can cause it?
  2. ML support in the PagePath module would be great!
  3. <div style="background: #999 url(<?php echo $page->myimage->httpUrl; ?>) no-repeat center"></div> That should work
  4. Hi @kaz This one work for me $image = $image->size(1600, 500)->httpUrl(); //// <div class="masthead masthead--<?= $template_name; ?>" style='background-image:url(<?= $image; ?>)'">
  5. Hi @Matzn Probably you are looking for https://processwire.com/docs/multi-language-support/multi-language-fields/#multi-language-field-values
  6. @nicolant Have you tried to $file->set('modified', $value);?
  7. @rsi I have tried to add CKEditor field as a custom image field and it and actually it unsupported, didn't know it, sorry for the misconception
  8. Hi @rsi You can setup custom fields for images, take a look at this blog post https://processwire.com/blog/posts/pw-3.0.142/#custom-fields-for-files-images
  9. @Bike Maybe you can hook to Page::path, allow URL segments on your '/book/' page and use the example code from there thread
  10. 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
  11. 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?
  12. $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.
  13. @fruid Have you tried to hook ProcessPageAdd::executeTemplate or ProcessPageAdd::buildForm?
  14. 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; } }
  15. @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.
  16. Hi @Violet The issue is that you set start as 0 on every page. Thake a look at this thread
  17. @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/
  18. Hi @joe_g Are you talking about images in the image field?
  19. 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
  20. 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?
  21. 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.
  22. Hi @Bike There is 'Overrides' tab in the field edit page. There you can enable options that you want to be able to override. After that you would be able to override them in repeater context.
  23. It worth to mentions https://htmx.org/ the successor to intercooler.js.
×
×
  • Create New...