Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Zeka

  1. Hi @picarica Not sure, but could you try to use $children = $root->children("start=0, limit=150"); Does it change anything?
  2. Hi @picarica Have you tried something like $pages->find('template=hry_home, children.count=0'); or $pages->find('template=hry_home')->not('children.count=0'); ?
  3. @kaz Determine what template(s) you want to use pagination with. Go to Admin > Setup > Templates > [Your Template] > URLs, and check the box for: Allow Page Numbers. Save. https://processwire.com/docs/front-end/markup-pager-nav/
  4. Hi @cb2004 https://processwire.com/api/ref/page/#pwapi-methods-manipulation $page->addUrl($url)
  5. Hi @Orkun // For view actions urls and all url for the pages wire()->addHookAfter("Page(template=post)::path, Page(template=post)::localHttpUrl, Page(template=post)::localUrl, Page(template=post)::localPath", function($e) { $page = $e->object; $pages = wire('pages'); $user = wire('user'); $language = $user->language; $langSegment = $pages->get("/")->localPath($language); $pageName = $page->localName($language, true); $e->return = $langSegment . "$pageName/"; }); // this hook is needed to change parent path so we can get right url in link above page name field wire()->addHookBefore("InputfieldPageName::render", function($e) { $inputfield = $e->object; $parentPageID = $inputfield->parentPage->id; $hookId = wire()->addHookAfter("Page(id=$parentPageID)::path", function($e) { $pages = wire('pages'); $user = wire('user'); $language = $user->language; $langSegment = $pages->get("/")->localPath($language); $e->return = $langSegment; }); wire()->addHookAfter("InputfieldPageName::render", function($e) use($hookId){ $e->removeHook($hookId); }); });
  6. @teppo Thanks for the update. I'm migrating a live site to the Wireframe and I need to set altFilename to wireframe for specific templates on the runtime via hook or somehow else only for superuser role. Is there is a way to do that?
  7. @teppo Hi and thanks for the great tool! Have a small issue with $persistent_cache_name in the current implementation it's not language-aware. Maybe it worth changing it to something like $persistent_cache_name = 'Wireframe/MethodProp' . '/' . $context . '/' . static::class . '/' . $name . '/' . $this->wire('page'); if($this->wire()->modules->isInstalled("LanguageSupport")) { $current_language = $this->wire()->user->language; $default_language = $this->wire()->languages->getDefault(); if ($current_language !== $default_language) { $persistent_cache_name .= . '/' . $current_language->id; } } or even move out to a separate hookable method, so we can tune names if needed.
  8. Hi. I have an issue with $page->url('+') and $page->url('-') where produce wrong URLs like site.com/some-page/-/page1/ and not site.com/some-page/page1/ etc. I have tested it on the latest dev version. I tracked down it to this line https://github.com/processwire/processwire/blob/d8945198f4a6a60dab23bd0462e8a6285369dcb9/wire/core/PageTraversal.php#L616 I think that there should be addition check like 'urlSegmentStr' => is_string($options) && !in_array($options, array('+', '-')) ? $options : '', Before opening an issue I would like to ask to confirm it. Thansk.
  9. @Falk $string = '<figure class="align_right"><img alt="some random alt text" src="path/to/image-file" /> <figcaption>some random caption text</figcaption> </figure> <p>some random text</p>'; $purifier = $sanitizer->purifier(); $purifier->set('HTML.ForbiddenElements', array('figure')); $purifier->set('Core.HiddenElements', array('figure' => true)); $clean = $purifier->purify($string); $text = $sanitizer->truncate($clean, [ 'type' => 'sentence', 'maxLength' => 400, 'visible' => true ]); $content = "<p>"; $content .= $text; $content .= "</p>"; d($content);
  10. @ryan Thanks for update! For some time I see a lot of such changes in the commits: //before $config = $this->wire('config'); $log = $this->wire('log'); //after $config = $this->wire()->config; $log = $this->wire()->log; Is there is some technical background for such changes or it's just a matter of preference? (I remember that you have explained it in some other thread or blog post, but I could not find it).
  11. if($this->showForBackend) { $this->addHookBefore('ProcessPageList::execute', function ($event) { wire('config')->styles->add($this->config->urls->PageHitCounter . 'PageHitCounter.min.css'); if($this->wire('input')->get('mode') != 'select') { $this->addHookAfter('ProcessPageListRender::getPageLabel', $this, 'addPageListHitCounter'); } }); }
  12. I have removed all logs and it bar started to load, then I have refreshed modules and again it stopped to load. http://360px.com.ua/monosnap/chrome_nrIfSIDBVh.png That`s all that I have in the logs. Changing mentioned line to any of this version fixes issue $entriesArr[$itemKey]['url'] = json_encode('<a href="' .$entry['url']. '">'.$entry['url'].'</a>'); // or $entriesArr[$itemKey]['url'] = '<a href="\\' .$entry['url']. '">'.$entry['url'].'</a>'; // or $entriesArr[$itemKey]['url'] = "<a href='".$entry['url']."'>".$entry['url']."</a>";
  13. @adrian I have tracked it down that if I remove ProcessWire Logs panel from the list of loading panels TB bar loads.
  14. 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?
  15. ML support in the PagePath module would be great!
  16. <div style="background: #999 url(<?php echo $page->myimage->httpUrl; ?>) no-repeat center"></div> That should work
  17. Hi @kaz This one work for me $image = $image->size(1600, 500)->httpUrl(); //// <div class="masthead masthead--<?= $template_name; ?>" style='background-image:url(<?= $image; ?>)'">
  18. Hi @Matzn Probably you are looking for https://processwire.com/docs/multi-language-support/multi-language-fields/#multi-language-field-values
  19. @nicolant Have you tried to $file->set('modified', $value);?
  20. @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
  21. 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
  22. @Bike Maybe you can hook to Page::path, allow URL segments on your '/book/' page and use the example code from there thread
  • Create New...