Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/24/2022 in all areas

  1. This new main/master version has more than 220 commits, resolves more than 80 issues, adds numerous new features, performance improvements and optimizations, and consumes HALF the disk space of our previous release— https://processwire.com/blog/posts/pw-3.0.200/ I've just merged the dev branch to the master branch so this new version is available now. I will add the 3.0.200 tag (which should trigger packagist and others) over this weekend or Monday.
    1 point
  2. Have just ugraded to the latest version with PHP 8.16! Went everything smoothly ! Thanks a lot Ryan and the other contributors ! PW is the best CMS !!!
    1 point
  3. Before editing/saving any repeater item call: $item1->of(false); $item1->title = "new title"; $item1->save(); More info here: https://processwire.com/api/ref/page/of/ Repeater items are themselves RepeaterPage objects which is a class that inherits from Page, hence the formatting flag applies too.
    1 point
  4. This error is related to Processwire, not to the module. Check the documentation for the Repeater field in the section "Using the API to add or remove repeater items": https://processwire.com/docs/fields/repeaters/ You can also check this post that talks about the same problem: https://processwire.com/talk/topic/16276-remove-repeater-item-by-page-id-rather-than-item-id/
    1 point
  5. Why is it not good practice? ? This is already supported (version 0.2.7):
    1 point
  6. Hi @wishbone I fully understand your feeling. I came from a non coder background, too. If you are willing to pay for a working contact form. I suggest you to buy Ryan's FormBuilder. Gideon
    1 point
  7. @bernhard yes sir it is the same software but I did a bit more work on it before my computer was lost/stolen. I recently recovered the hard drive and got it up and running again, and hated to scrap the project. As stated earlier by @dynweb, unfortunately I agree and I don't really see much use for a forum anymore. I appreciate everyones time that posted ?
    1 point
  8. I don't know much about the tools you mentioned and regarding your JSON generation issue I'm not sure I see why the modules you mentionned don't fit the bill, but have you also checked/tried: ? Assuming you have templates named "post", "movie", "page",... you could have something like: $wire->addHook("/api/(post|movie|page)/(.*)", function($event) { $template = $this->templates->get($event->arguments(1)); if(!$template) return; header("Content-type: application/json"); $fields = $template->fieldgroup->explode("name", ["key" => "name"]); if($event->arguments(2)) { $page = $this->pages->findOne("template=$template,name=".$event->arguments(2)); if($page->id) { return $page->pageQueryJson($fields); } } return $this->pages->find("template=$template")->pageQueryJson($fields); }); This way you could have pw.domain/api/post returning all posts and then you could query a specific one with pw.domain/api/post/page-name. (one thing to note is the module does not handle repeaters (or other third parties fields) out of the box, though the docs seem to mention how to do so actually it does but I have an issue in my setup, I think) In case this doesn't help or I didn't get your issue, would you mind to elaborate ?
    1 point
  9. A project I worked on the beginning of this year. Simple website with great content. Used the Repeater Matrix Field to define custom content blocks so the client has a few options to build nice content pages. https://volstok.com/
    1 point
  10. No problem at all - there is nothing wrong with the approach you took - completely valid code and appropriate in many cases so long as you don't need additional logic. Since you're new to PHP (and maybe other scripting languages?), you may not have seen ternary operators before, so here is a great explanation: http://davidwalsh.name/php-shorthand-if-else-ternary-operators They shouldn't be used instead of if/else in all situations, but in many cases they can make code simpler. If used incorrectly with too much nesting, they can become horrible to read If you want to stick to the style you have, you could do this: $staticPages = $about->children("sort=name"); foreach($staticPages as $staticPage) {?> <li class="list-group-item<?=$page == $staticPage ? " active" : ""?>"><a href="<?=$staticPage->url?>"><?=$staticPage->title?></a></li> <?}?> I find it messier, but others may prefer it. Also be warned about php shorttags: <?= vs <?php echo - not all servers will currently support shorttags, although it is the default in more recent versions of PHP.
    1 point
×
×
  • Create New...