neildaemond

Members
  • Content Count

    129
  • Joined

  • Last visited

Community Reputation

38 Excellent

About neildaemond

  • Rank
    Sr. Member

Contact Methods

  • Website URL
    http://www.neilpahl.com

Profile Information

  • Gender
    Male
  • Location
    Hong Kong

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. neildaemond

    It's been so long I don't remember the details. But, I found that js file here now: http://archived.neilpahl.com/PWformToWizard-validate.js
  2. neildaemond

    I'm I was (solution below) experiencing the same as below on PW 2.5.2, after installing via softaculus(which uses minimal site profile) on a cpanel based hosting: except, When I try to reach www.seconddomain.com it displays as if I'm using www.maindomain.com Also, http://www.seconddomain.com/www.seconddomain.com/ redirects to http://www.seconddomain.com/ SOLVED: needed to add www.seconddomain.com to $config->httpHosts in /site/config.php
  3. neildaemond

    I've sorted it. I just had to re-install the PageLinkAbstractor plugin and all those {~root_url} and {~page_5813_url} started getting converted.
  4. neildaemond

    I'm seeing this in a site which I'm migrating... how should I go about fixing it? I still have access to the working legacy site.
  5. neildaemond

    I still see an extra "</script>" tag at the bottom right before the </body> ... I saw it by viewing the source in the browser and it's there on all pages. It's probably some extra markup in your foot.inc file... if you kept using those files.
  6. neildaemond

    It's been a while since I first made this site, and there has been some updates The old site design which I first posted about was kept on corporate.ccw-global.com and I've done bootstrap based redesigns (UI focused) for www.ccw-global.com and hk.ccw-global.com Processwire has allowed or content writer to plant focused article/blog feeds and maintatin a SEO friendly URL structure. Article feeds are like those found on: http://hk.ccw-global.com/specialist-insurance/specialist-articles/ http://hk.ccw-global.com/health-insurance/resources/articles/ We've been able to upload TONS of pages, and keep them well organized with PW's nice backend and were able to use custom fields extensively to allow content writers to insert proper meta-data. Very happy with how it's working for us. Almost forgot, we added muli-language capability on http://www.ccw-global.com/es/
  7. neildaemond

    sorry to highjack the thread but WOW, multi-language urls have come a long ways since I've last implemented the hacked urlsegment detection version we used to have... do links in the content switch to the appropriate language url automatically? Alice, I think that diogo was saying how instead of creating two branches of pages, you could use multi-language fields and urls in your pages to give them multi-language capability. This will result in much less overhead of creating duplicate pages... but, slightly less flexible if you wish to have different content based on the language (which doesn't seem to be te case). If all your pages are going to be translated, I recomend using multi-language fields and urls.
  8. neildaemond

    I'm seeing an issue with importing Chinese. I have a column which is importing Chinese text. However, only the rows which contained an English letter in it will import. The imported field will omit the initial Chinese, then start with the English segment, then the rest of the Chinese will follow as expected.
  9. neildaemond

    That caught my attention as well
  10. neildaemond

    hey guys, I tried putting the following code into /site/modules/SetPublishDate.module /** * * "Set Publish Date" module * */ class SetPublishDate extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'Set Publish Date', 'version' => 001, 'summary' => 'your summary', 'singular' => true, 'autoload' => true ); } /** * Initialize the module * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. * */ public function init() { // add a hook after the $pages->save $this->pages->addHookAfter('save', $this, 'afterSave'); } public function afterSave($event) { // get page object saved $page = $event->argumentsByName('page'); // only on pages that have a publish_date field if(!$page->template->hasField('publish_date')) return; if($page->is(Page::statusUnpublished)) { // if unpublished, empty the field if not empty already if(!$page->publish_date) return; $page->publish_date = ''; $page->save('publish_date'); } else if(!$page->publish_date) { // if page (published) and field not populated, add current timestamp $page->publish_date = time(); $page->save('publish_date'); } } } However, in the module section it will detect the module but then shows as version 0.0.0 and summary 'inactive' after pressing 'install', if get these errors: /** * * "Set Publish Date" module * */ class SetPublishDate extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'Set Publish Date', 'version' => 001, 'summary' => 'your summary', 'singular' => true, 'autoload' => true ); } /** * Initialize the module * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. * */ public function init() { // add a hook after the $pages->save $this->pages->addHookAfter('save', $this, 'afterSave'); } public function afterSave($event) { // get page object saved $page = $event->argumentsByName('page'); // only on pages that have a publish_date field if(!$page->template->hasField('publish_date')) return; if($page->is(Page::statusUnpublished)) { // if unpublished, empty the field if not empty already if(!$page->publish_date) return; $page->publish_date = ''; $page->save('publish_date'); } else if(!$page->publish_date) { // if page (published) and field not populated, add current timestamp $page->publish_date = time(); $page->save('publish_date'); } } } Error Class 'SetPublishDate' not found (line 437 of /var/www/xxxx/wire/core/Modules.php) This error message was shown because you are logged in as a Superuser. Error has been logged. Any ideas? I'm using PW2.2.9 EDIT (SOLVED) -> I left out the "<?php" at the beginning of the file.
  11. neildaemond

    did this ever end up being an official module? did anyone improve on this method?
  12. Thanks for the responses and good Idea Ryan, I'll try that if I have those kind of migration issues. I ended up upgrading my staging and dev server settings so that I don't need to work on sub-directories. It was a change I had been wanting to make with virtual hosts on my staging server, the urls now look like "cilentname.mydomain.com" instead of "mydomain.com/clientname/" For development within my own network, I updated my dev machine's /etc/resolve.conf so that the url "clientname" will resolve to the dev server ip. Again, setting up virtual hosts on my dev machine. I feel much more confident adding links into content with the new setup and don't feel obligated to rely on pageLinkAbstractor too much
  13. good question, Ryan and it lead me to the solution. Although I had "allow page numbers" enabled on the template containing the paginationMarkup (the blog/news feed), I didn't have it enabled on the 'language-gateway' template. So, settings "allow page numbers" on the 'language-gateway' template solved the issue Perhaps we can mention this little caveat in the documentation
  14. i've used "Example 3: Display a different language based on URL pre-segment" from the guide to make a site multi-language capable.. my language gateway looks like: <?php $user->language = $languages->get($page->name); $path = '/'; foreach($input->urlSegments as $segment) { $path .= $segment . '/'; } $mypage = $pages->get($path); if(!$mypage->id || !$mypage->viewable()) throw new Wire404Exception(); //replace local navigation links $out = $mypage->render(); $regex = '{(<a [^>]*href=["\']' . $config->urls->root .')(["\']'; $topnav = $page->parent->children(); foreach($topnav as $p) $regex .= "|" . $p->name; $regex .= ")}"; $out = preg_replace($regex, '$1' . $page->name . '/$2', $out); echo $out; the regex works quite well for everything else, but but kind of skews up on the 'blog/news' page which uses pagination. besides the fact that the pagination links end up as 'site.com/blog/blog/page2' instead of 'site.com/blog/page2', even when manually entering 'site.com/blog/page2', 4040 error is thrown. I'm guessing that things go bad here: $mypage = $pages->get($path); if(!$mypage->id || !$mypage->viewable()) throw new Wire404Exception(); since "path/to/page/page2" will not not return a page. Also, removing the "throw new 404" line, I end up with a blank page. Any suggestions? Thanks,
  15. It seems that there may be an issue with using Page Link Abstracter module with TextAreaLanguage. Whether I'm using a rich-text editor (i tried both TinyMCE and CKEditor) or plaintext field which contains a link or image, the above error msg in OP is shown and the page doesn't save. This only applied to the 'default' language, as I was able to save links and images in the language specific sections. After disabling the Page Link Abstracter for the field in question, there were no more errors. Unfortunately, I’m building my page under a sub-directory so being able to use page link abstracter will be nice.