Jump to content

Zeka

Members
  • Posts

    938
  • Joined

  • Last visited

  • Days Won

    8

Zeka last won the day on May 25

Zeka had the most liked content!

About Zeka

  • Birthday 04/12/1989

Profile Information

  • Gender
    Male
  • Location
    Kiev, Ukraine

Recent Profile Visitors

3,587 profile views

Zeka's Achievements

Hero Member

Hero Member (6/6)

1k

Reputation

2

Community Answers

  1. @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/
  2. Hi @cb2004 https://processwire.com/api/ref/page/#pwapi-methods-manipulation $page->addUrl($url)
  3. 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); }); });
  4. @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?
  5. @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.
  6. 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.
  7. @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);
  8. @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).
  9. 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'); } }); }
  10. 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>";
  11. @adrian I have tracked it down that if I remove ProcessWire Logs panel from the list of loading panels TB bar loads.
  12. 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?
×
×
  • Create New...