Jump to content

bernhard

Members
  • Posts

    6,671
  • Joined

  • Last visited

  • Days Won

    366

Everything posted by bernhard

  1. Haha yeah I'm a fan of chaining ? eg https://github.com/baumrock/rockseo Thx for clarifying. Just wanted to make sure I'm not missing anything ?
  2. Nice, thx for sharing the results ? Though I'm still not sure why RockFinder helped here? I think it would be the same to do this: <?php $end = strtotime( "2021-02-27 23:59:59"); // loop $database->beginTransaction(); $ids = $pages->findIDs("template=receipt, numChildren=0, created<$end, limit=5000") foreach($ids as $id) $pages->delete($pages->get($id)); $database->commit();
  3. RockFinder does not bring you any benefit here as it relies on the native findIDs. Have a look here:
  4. Got hit by this as well. I'm having role "admin" for managing the website (aka webmaster role) I want the users of group "admin" to be able to create other users with role "admin", but the role is blocked: --> you are not allowed to change this role I've also tried to add an "user-admin-admin" permission and assign that to the "admin" role. Nothing. How do you handle that? Am I missing something?
  5. Yeah that's what I tried, but it does not work here. But even if it did I think it would not be the best solution as this is quite hidden and not obvious to users that don't know PW. Just hiding notifications is not an option as they have a purpose. I haven't looked into the implementation of SystemNotifications yet as I wanted to double check if I'm missing anything here (similar to the double click feature of deleting all files of a files field).
  6. I'm using Session Handler DB + System Notifications on a site and I get lots of notifications when I log in from time to time. Is there any way to close all notifications at once? I have to click 75 times to close 75 notifications... This is really annoying because the notifications persist through the session until I close them.
  7. I'm talking about the core fieldtype. I don't have the external decimal module installed.
  8. No matter what I try I end up with an empty decimal field. I tried inputting 1.5 as well as 1,5. I also tried both settings for the input-type (text/number). Decimals is set to 2. I can only store integer numbers. Could you please try that so that I know if I should invest more time? Thx!
  9. Or you use RockHeadless ? Referencing to the other post...
  10. v0.0.4 adds callbacks to easily define the returned values of your selected fields: <?php // in site/init.php $rockheadless->return('rockblog_cover', function($page) { $images = $page->rockblog_cover; if(!is_array($images)) return; $file = $images[0]['data']; return "site/assets/files/{$page->id}/$file"; }); I think this should make it really simple to get a quick API while still being easy to customize.
  11. Well... what you are discovering is exactly why I built RockFinder. The first version was built before findRaw existed but I'm still using the current version RockFinder3 for RockGrid because it does all the things you mentioned properly with an easy to use syntax.
  12. What about this? https://github.com/baumrock/RockHeadless
  13. Why? Were you not aware of RockFinder? Sorry, OT ?
  14. Thx @wbmnfktr that helps So what is missing with the AppApi module? I've never used it, but I like the topic and it sounds like it would be fun to build a module for it... so I'll try to understand better. How do the other systems handle access control? How should that be done by PW? On a template level? On a field level? I understand that. I'm a huge fan of standardizing things ?
  15. No - I was just looking at the old version and did not instantly understand it, so I thought I'd change it a little bit. But there are still 1000 other options ? In terms of performance I don't think that there is any noticable difference between both versions.
  16. Actually I'd probably do it this way today (refactoring again ? ) <?php $this->addHookAfter('ProcessPageList::find', function (HookEvent $event) { $event->return->each(function($p) use ($event) { if($p->template == 'admin') return; // keep if($p->template == 'basic-page') return; // keep if(!$p->editable() AND !$p->addable()) $event->return->remove($p); }); });
  17. Same here. I feel like we have everything and try to understand what is missing and what others to differently (better)...
  18. Not sure if I'm missing something... No module, 2 lines of code: $restaurants = $pages->findRaw("template=restaurant", ['id', 'title', 'modified']); $json = json_encode(['restaurants' => array_values($restaurants)]);
  19. I'm still curious how that "out of the box" would look like and how other platforms are working in that regard... As a detailed step by step use case.
  20. This is what I meant: I install Forestry on my host Then I create Template XY Then I add fields X, Y, Z to the template Then I add Module X to get JSON Feed Then I create a Frontend and access this feed Steps 4+5 are missing in ProcessWire
  21. Could you show the exact steps that are necessary to get what you want when using one of these systems? And list what you are missing with PW and how in your opinion it would make sense to be?
  22. https://github.com/processwire/processwire-issues/issues/1533
  23. Same idea, but personally I've never used it or seen anybody using it here on the forum ?
  24. So I recall, and still waiting ? It was on top of his list but... EDIT: https://processwire.com/blog/posts/roadmap-2017/#whats-in-store-for-processwire-in-2017 To quote ryan (4. Jan 2022): https://processwire.com/talk/topic/24876-pw-30170-– core-updates/?do=findComment&comment=209625
  25. I also prefer to use foreach + endforeach or if + else + endif when working in markup. It's a lot cleaner to read than single brackets being somewhere in the file within <?php and ?> You can get rid of the if/else though because you are outputting the wrapping div of $date anyhow. This is how I would format your code: <?php $items = $pages->find("homepage_item=1"); $date = $item->arbitrary_publish_date; ?> <div class="row mb-2"> <?php foreach($items as $item): ?> <div class='col-md-6'> <div class='row g-0 border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative'> <div class='col p-4 d-flex flex-column position-static'>"; <h3 class='mb-0'><?= $item->title ?></h3> <div class='mb-1 text-muted'><?= $date ?></div> <p class='card-text mb-auto'><?= $item->summary; ?></p> <a href='<?= $item->url ?>' class='stretched-link'>Continue reading</a> </div> <div class='col-auto d-none d-lg-block'> <svg class='bd-placeholder-img' width='200' height='250' xmlns='http://www.w3.org/2000/svg' role='img' aria-label='Placeholder: Thumbnail' preserveAspectRatio='xMidYMid slice' focusable='false'> <title>Placeholder</title> <rect width='100%' height='100%' fill='#55595c' /> <text x='50%' y='50%' fill='#eceeef' dy='.3em'>Check it out!</text> </svg> </div> </div> </div> <?php endforeach; ?> </div> @taotoo you have some missing echo statements in your code Note that I'm also wrapping code after 80chars usually, see https://stackoverflow.com/questions/578059/studies-on-optimal-code-width
×
×
  • Create New...