Jump to content

bernhard

Members
  • Content Count

    3,886
  • Joined

  • Last visited

  • Days Won

    127

bernhard last won the day on March 31

bernhard had the most liked content!

Community Reputation

5,285 Excellent

About bernhard

Contact Methods

  • Website URL
    https://www.baumrock.com

Profile Information

  • Gender
    Male
  • Location
    Vienna, Austria
  • Interests
    Sports

Recent Profile Visitors

15,909 profile views
  1. If using subdomains is an option I think it would be easier to serve the blog from blog.example.com
  2. If you are new to hooks this mini-tutorial might be helpful: https://processwire.com/talk/topic/18037-2-date-fields-how-to-ensure-the-second-date-is-higher/?tab=comments#comment-158164
  3. Thx. But how do I integrate them in my project (for testing and playing around with the chart.js samples)? My javascript level is unfortunately not the best, so I'm overwhelmed by all those new module/import/export stuff and how to use it 😞
  4. @fedeb Very interesting, thx for sharing! πŸ™‚ @ryan Wouldn't it be great to abstract all that findings/knowledge into the files API? Importing data from CSV is a quite common need and thinking about all the pieces (like utf8 encoding, wrong delimiters etc) can be tedious and does not need to be πŸ™‚ $file = "/my/large/file.csv"; $tpl = $templates->get('foo'); $parent = $pages->get(123); $options = [ 'delimiter' => ',', 'length' => 100, 'firstLineArrayKeys' => true, ]; while($line = $files->readCSV($file, $options)) { $p = $this->wire(new Page()); $p->template = $tpl; $p->parent = $parent; $p->title = $line['Foo Column']; $p->body = $line['Bar Column']; $p->save(); }
  5. @adrian would it be possible to get a refresh&clear link here? I'm developing processmodules quite extensively those days and when adding a new nav item I always need to click "refresh" for triggering the module to catch the changes and then "clear session and cookies" to make the change visible in the menu. It would be great to get all that via one click. We know how annoying plenty of reloads get when we have to use them a lot... πŸ™‚ Thx for considering!
  6. But it will not help others that may have the same problem in the future πŸ˜‰
  7. Thx, unfortunately that does not help. That's now a regular line chart having "stupid" axis that are not aware of the date (having wrong sort order and wrong distance). Also I'd really need some help how to use all the examples in the docs and how I can customize them for my needs... The installation section (https://www.chartjs.org/docs/latest/getting-started/installation.html) does not help me either - I have no idea about all those module packer systems. I've tried to do some research but it did not help.. Maybe someone can give me pointers in the right direction πŸ™‚ thanks!
  8. Looking at the recent discussion in this thread I wonder if the distinction between your module and mine is not about having a UI or not but is more about where and how you want to use it. I have never ever had the need for "migrating" content of an RTE field to another site for example. And I have never ever had the problem of changing ids on that process. Why? Because my module relates to everything BUT content. Content should be part of the site and not part of the migration. That means I can develop a system that I can setup multiple instances of (for example a local dev and a live production system, or as another example this could also be one setup for sports clubs that is used by multiple sports clubs running the same system and getting the same updates - but keeping thier content). Your module seems to be targeted to another world. Migrating content (and maybe also necessary config fields/templates) from one site to another? Am I right or did I get a wrong impression here?
  9. Can anybody please help me getting this chart.js work? 😐 https://jsfiddle.net/baumrock/f96483en/1/ It should look like this example in the docs, but I can't just copy the code of the docs over because I don't have all those util functions on my setup. Maybe someone could explain how I can make those docs examples work on my laptop as well? https://www.chartjs.org/docs/latest/samples/scales/time-max-span.html
  10. This is what I came up today: <?php /** * Show warning of duplicate invoices * This will be executed on ready() of admin pages */ public function showDuplicatesWarning() { $result = $this->wire->database->query("SELECT COUNT(pages_id) AS cnt, GROUP_CONCAT(pages_id SEPARATOR '|') AS ids, `data` FROM field_yourfieldname LEFT JOIN pages ON pages.id = pages_id WHERE pages.status = 1 GROUP BY `data` HAVING cnt > 1"); foreach($result->fetchAll(\PDO::FETCH_OBJ) as $dup) { $pages = $del = ""; foreach($this->wire->pages->find("id=".$dup->ids) as $page) { $pages .= "$del<a href={$page->editUrl}>#$page</a>"; $del = ', '; } $file = $dup->data; $this->warning("Duplicate: $file found on pages $pages", Notice::allowMarkup); } } LEFT JOIN ... WHERE ... pages.status = 1 makes sure that files of pages that are in the trash are not counted πŸ™‚ PS: The code is part of a module and attached via hook: <?php $wire->addHookAfter("Pages::saved()", function($event) { $invoices = $this->wire->modules->get('Invoices'); $invoices->showDuplicatesWarning(); });
  11. Just edit your page in the backend and then go to the tracy console and enter this: db($page); You should see a dump of your page, something like this: Then type dump($page->heroimage) and show us the results.
  12. Your $page->heroimage seems to be something else than an array of pageimages... Are you using tracy? Then a bd($page->heroimage) could bring light into the dark πŸ˜‰
  13. Working with PW now for several years and still have that feeling almost every day πŸ™‚
  14. I know that a runtime field is tempting because it abstracts complexity but such things can quite easily be done via hooks as well. That means you don't need a module and you get even more possibilities: <?php $wire->addHookAfter("ProcessPageEdit::buildForm", function($event) { $page = $event->object->getPage(); if($page->template != "mytemplate") return; $form = $event->return; if($f = $form->get("title")) { $next = $page->next; if($next) $f->notes = "Title of next page: ".$next->title; } });
  15. Congratulations for your achievements πŸ™‚ I think https://github.com/BitPoet/ProcessCKInlineComplete could also be a great option? Just type @... and get suggested allergens!
Γ—
Γ—
  • Create New...