Jump to content

Zeka

Members
  • Posts

    1,065
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zeka

  1. $this->addHookAfter('ProcessPageListActions::getActions', function($event) { $actions = $event->return; $actions['view']['name'] = 'SomeValue'; $event->return = $actions; });
  2. Hi @horst Thanks for the code; I have found that there is 'saveFileCols' method that can be used to set values of these properties in DB. $fieldtype = $fields->get('image')->getFieldtype(); $image = $page->get('image'); $fieldtype->saveFileCols($page, $fields->get('image'), $image, [ 'width' => $image->width, 'height' => $image->height, 'ratio' => $image->ratio, 'filesize' => $image->filesize ]);
  3. Hi @abmcr I think you can try to use wireLangReplacements https://processwire.com/blog/posts/pw-3.0.155/#new-wirelangreplacements-function
  4. Hi @gebeer Not sure that this issue is PW relative. Take a look at this thead on apple discussions: https://discussions.apple.com/thread/252479616
  5. Also you can use owner selector like template=tag, tags.owner.template=post, limit=10 Where 'tags' is your page reference field used in blog post template and 'post' is the name of this template.
  6. Hi @BrendonKoz I have never used markup regions, so no help here, but I see that you use Processwire instead of ProcessWire namespace and there is debug section in the docs, so maybe it could help to find what is going on https://processwire.com/docs/front-end/output/markup-regions/#debugging-regions
  7. Hi @rushy You can use WireCache for it https://processwire.com/api/ref/wire-cache/
  8. Hi @applab Probably somewhre in your code you are calling $modules->get("MyModule"). So just check before getting this module. if ($modules->isInstalled("MyModule")) { echo $modules->get("MyModule")->renderBlock(); } Also if this module is required by another module it will be installed (Not sure, but looks like it behaves in this way).
  9. Also worth to mention 'owner' selector https://processwire.com/blog/posts/processwire-3.0.95-core-updates/
  10. Hi @manlio Have you seen this module? https://github.com/teppokoivula/ProcessLoginHistory Also you can use Google Analytics for tracking logged in users https://phppot.com/php/track-individual-logged-in-users-using-google-analytics/
  11. Hi @rastographics "task_status" is select options field? Have you try to 'task.task_status.title=finished' ?
  12. Hi @Crowdland Technology There has been a lot of changes in 3.0.185 that relative to ML support and other part of request handling so it's better to stay for some time on the stable 3.0.184. There is already an opened issue https://github.com/processwire/processwire-issues/issues/1447 So you can describe your case there
  13. Hi @prestoav Just find your selected page in the page tree and there will be 'Unselect' option. See screenshot at the thread
  14. Hi @PascalKonings You can use page refference field by implementing custom fields for you image field https://processwire.com/blog/posts/pw-3.0.142/
  15. // requeire https://processwire.com/modules/file-validator-svg-sanitizer/ and $svgSanitizer = $this->wire()->modules->get('FileValidatorSvgSanitizer')->getSvgSanitizer(); $svgSanitizer->minify(true); $svgSanitizer->removeXMLTag(true); $data->setArray([ 'inline_svg' => $svgSanitizer->sanitize($this->wire()->files->fileGetContents($category->get('svg')->filename)), ]);
  16. Hi @ryan Thank you for the updates and new module. I have used $session a lot in custom modules in the admin area, but not so much on the frontend (except areas where logged-in users could interact with site and basic $session redirects); I just checked the 'assets/sessions' folder which contains 115711 files (462.92 Mb) on one of the sites that have 50k visitors per day and I think that I would benefit if I disallow session for the guest visitors on the fronted, but I'm not sure about what I should consider in this case. Will $session->redirect etc work?
  17. Hi @horst. RewriteCond %{HTTP_HOST} ^(www\.)?example-b\.com$ [NC] RewriteRule ^(.*)$ http://www.example-a.com/subpage5/$1 [L,R=301] Maybe it's cache issue? 301 redirects are cached hard by the browser. For testing it's better to set 302 or test with browser tools open and cache disabled.
  18. Hi @sebr As for the first point. You can copy LanguageTabs module to the site/modules folder and adopt for you needs. As for the second point. There is no ready to use solutions but it doable by hooks. I've been working on the two module. One that allows to disable default language and the second one that add reuquirement for non default langauges of multilangauge fields and check if they are filled. They are site specific but you can use them as starting point and try to addot for your needs.
  19. Hi. You can try to use $page->if() https://processwire.com/api/ref/page/if/ if($page->if('image')) { // ... } $page->if('image', function($image) { // ... })
  20. Hi. I've never used this feature by from this thread I can assume that it meens that user has page-view permission for the corresponding template.
  21. @fbg13 The link is dead, where I can download your module? @eelkenet maybe you have an copy?
  22. Hi. https://github.com/processwire/processwire/blob/master/wire/core/Templates.php#L303 So it looks like cloning of the template doesn't clone fields context for template fieldgroup. You can do it by api like $sourceFieldgroup = $fieldgroups->get('service'); $newFieldgroup = $fieldgroups->get('test'); foreach ($sourceFieldgroup as $field) { if($sourceFieldgroup->hasFieldContext($field) && $newFieldgroup->hasField($field)) { $contextArray = $sourceFieldgroup->getFieldContextArray($field->id); $newFieldgroup->setFieldContextArray($field->id, $contextArray); } } $newFieldgroup->saveContext(); Probably there is better way but it worked for my case.
  23. Hi @millipedia. Nice write-up. How did you get forcing of PDF downloading? Recently I was working on the project where they had a large amount of science articles in PDFs and they wanted to force downloading of these files with settings custom file names (user provided). There is the code that I use, but for some reason some of PDFs files still open 'inline' in Chrome. $wire->addHook('/download/{pageid}/{basename}/', function ($event) { $page = $this->wire()->pages->get($event->pageid); if ($page->id) { $file = $page->filesManager->getFile($event->basename); $filename = $file->description ? $file->description . '.' . $file->ext : $file->basename; wireSendFile($file->filename, [ 'downloadFilename' => $filename, 'forceDownload' => true, 'exit' => true, ]); } else { wire404(); } });
  24. There some usefull examples if you are in ML setup
×
×
  • Create New...