Jump to content

BitPoet

Members
  • Posts

    1,329
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by BitPoet

  1. It does (with a little tweaking). I've basically set it up so I have a php class with all the neccessary functionality and created both a graphical interface in a backend page to do individual tests (simple source+target selection and optionally go one level deeper) and a cli wrapper for bulk migration and creating dumps for recalcitrant pages. The biggest problem will be tweaking the HTML contents and contained links so they don't get shredded in CKEditor. Some were created with older versions of TinyMCE (with some home-brewed tweaks that I'd now avoid like the plague), some bulk imported from centuries old pages created in Netscape Navigator and Frontpage as far back as the middle of the nineties, so it's quite a mess.
  2. I'm migrating our corporate Intranet from Contenido to PW. ~8500 pages, 2 languages, 400+ users, about 20 modules and templates. I'm a little more than halfway there right now, most modules are working as planned and the first migration tests look promising, though I'm pretty sure a few headaches will be popping up when I start with bulk imports (though those won't be PW's fault...).
  3. Or, going completely overboard using recursion, only loading pages to the requested depth: function getAncestors($pg, $level) { $retPages = (new PageArray())->add($pg); if( $level > 0 ) { foreach( $pg->children As $child ) $retPages->add(getAncestors($child, $level - 1)); } return $retPages; }
  4. I did my first fork and pull request with git - which turned out to be far less mysterious than anticipated - and Ryan already accepted my fix. Thanks!
  5. Here's my first serious attempt at a PW module. I have the need that pages shouldn't be "published" in all languages at once, so I've put together a PageLangPublish module. It adds both buttons for publishing/unpublishing of each language to the page tree and status icons (from image fields added to each page in admin/languages) next to the page title in the tree. You can find the module at github under https://github.com/BitPoet/PageLangPublish I've probably done a lot of things quite awkwardly (even incorrectly) there, so I'd be grateful for any pointers and ideas. The module also adds a hookable isLanguageViewable method to the Page class. Usage example: $topnav = array(); foreach($homepage->children as $item) { if( $item->isLanguageViewable($user->language) ) { $topnav[] = "<a class='topnav' href='{$item->url}'>{$item->title}</a>"; } } echo implode(" | ", $topnav); Here's a screenshot:
  6. Thank you for the pointer, adrian. I've commented on the issue.
  7. Not sure if this is by design - or if I'm perhaps missing the obvious. I'm just getting my feet wet with pw (2.5.3) and have created a partial sitemap template (nothing fancy, just recursing through a partial tree). When I added a page field to my sitemap template, selected a page and tried to save, I got a memory limit exceeded error. The problem appeared only when the page picked in the page field was the same as the one being edited. public function resetTrackChanges($trackChanges = true) { parent::resetTrackChanges($trackChanges); foreach($this->data as $key => $value) { if(is_object($value) && $value instanceof Wire) $value->resetTrackChanges($trackChanges); } return $this; } Looking at this method, I guess it's easy to see that this will run in an endless loop if one of the properties of $page is once again $page. As a quick fix, this could be cured by comparing $this and $value in the conditional, but there'd still be a possibility of building circular patterns that have the same problem. Not sure how to go about that. Edit: Of course, InputfieldPage prevents me from even assigning the same page here at all (my fault). Still, the check in Inputfieldpage::isValidPage appears to happen too late.
×
×
  • Create New...