Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/03/2020 in all areas

  1. @kongondo, still no announcement? ? I was sending ecommerce quotes all summer thanks to government grants and still hoping to at least beta test the new Padloper.
    3 points
  2. Will second https://www.11ty.dev/ as an awesome static site generator, really great product. For a list of lots of options check https://www.staticgen.com/ Gatsby isn’t really a pure static site generator, it’s more a framework for creating progressive single page app websites with react. It has a heavy reliance on graphql and can handle server side rendering like next / nuxt / sapper. It would actually be pretty overkill to use gatsby just for a completely static site (ie one that doesn’t use a database of any kind). The power of these frameworks is data is pulled in from one or more sources at build time which is used to programatically create pages / populate content. This data can come from the file system, from a csv file, but mostly it is stored in a cms. There are lots of “headless cms” out there (I like to think of these as more cms as a service) that you will read about being used with gatsby. The most promising of these in my opinion is https://www.sanity.io/ which is a pretty amazing product. However there is nothing stopping you from using PW for this. 11ty makes it super easy to grab data from anywhere to use at build time (unlike gatsby where it all has to be ported into its own graphql instance), and if you wanted you could have all your content stored in PW, create some json api endpoints manually or using a module like the graphql one, and use that data to build a flat HTML static site with 11ty that you host on netlify or zeit. Obviously this requires rebuilds when content changes, and doesn’t allow much interactivity, which is where the more complex feature set of gatsby comes in... server side rendering etc. Another project I am really digging at the moment which I think more meets the topic of this post is https://saber.land/ If you are into vue definitely check it out.
    2 points
  3. 2 points
  4. Don't forget that Tracy has a PHPInfo panel that you can use ?
    1 point
  5. @adrianThanks for the speedy reply. Most odd, WHM/Cpanel was reporting PHP 7.2, but I double checked with a "phpinfo" file & it showed PHP5.6! I reset the PHP version to PHP 7.2.32 & it's cleared the error. Apologies for the incorrect info & thanks for the fix for <7 (& for such a great module)!
    1 point
  6. Good to know about the underscore. I'll do that. Thank you for the help. I'm going to try this this evening and if it works there will be multiple problems solved here. Cross your fingers for me please. ?
    1 point
  7. @kongondo I'm just noticing that my previous message didn't go through... I was saying that for your information, I had replaced all my ~= operators with either ^=, ~*= or = depending on my use cases. It did the trick although I'm losing the original 'whole words' searching capability... but at least I'm not stuck ? I wen tahead and submitted a 'bug' issue as you advised. Not sure this is a real bug since I have a feeling somebody else would reproduce it if it was, but I di dmy best explaining the issue and I hope it can help ! If anybody needs more information about it, just ask. I'll keep an eye on this issue since I would like to understand and solve it in a better way ! But thanks again for your help !
    1 point
  8. This works properly: $this->pages->addHookAfter('save', function($event) { $page = $event->arguments[0]; if($page->template != 'mytemplate') return; if($page->venue && $page->city && $page->country && $page->date) { $page->setAndSave('title', $page->venue . ", " . $page->city . ", " . $page->country->title . ", " . $page->getFormatted("date")); } else { $page->setAndSave('title', 'Untitled'); } });
    1 point
  9. Perhaps I'm missing something, but couldn't you do something like this in a saveReady hook? $pages->addHookAfter('saveReady', function(HookEvent $event) { $page = $event->arguments(0); if($page->template == 'book') { $page->my_sort_field = implode(' ', array_filter([ $page->subject, $page->cleanauthor, $page->cleantitle, ])); } }); ... and now that your sort field (which could be a hidden text field, or a textarea if there's a lot of data, which I assume is not the case) contains a single value, you can sort results by that. As far as I can tell the only issue here is that you'll basically have the same data stored multiple times ?‍♂️ (Unless I've misunderstood you, and you actually want to keep all books that have a subject before any of those that don't, etc. But in that case a simple sort by multiple field seems enough.)
    1 point
  10. Just wanted to make a note here that I just wasted several hours trying to debug why I couldn't manually add or delete rows from a table when this module was installed. Turns out it was PHP's max_input_vars setting being too low, but no error was being logged anywhere. In the process of debugging I did fix a few bugs related to Table fields inside Repeaters and some other cleanup, so perhaps it was a worthwhile waste of time after all ?
    1 point
  11. It's already possible to list commercial modules ? For example Padloper: https://modules.processwire.com/modules/pad-loper/ Or dynamic selects: https://modules.processwire.com/modules/process-dynamic-selects/
    1 point
  12. Just use the field or Selector ? https://processwire.com/docs/selectors/#or-selectors2 <?php $events = $pages->find('template=calendar-post, Start_date|End_date>=today, sort=Start_date, limit=10'); ?>
    1 point
  13. Here's some updated code to try: // Find IDs of users that have been active in the last $mins number of minutes function onlineUserIDs($mins, $limit = 500) { $table = SessionHandlerDB::dbTableName; $seconds = $mins * 60; $sql = "SELECT user_id " . "FROM `$table` " . "WHERE ts > DATE_SUB(NOW(), INTERVAL $seconds SECOND) " . "AND user_id!=40 " . // exclude guest "ORDER BY ts DESC LIMIT $limit"; $query = wire('database')->prepare($sql); $query->execute(); $results = $query->fetchAll(\PDO::FETCH_COLUMN); return $results; } // User IDs active in the last hour $online_user_ids = onlineUserIDs(60); // Convert to string for use in selector $online_user_ids = implode('|', $online_user_ids); // Online users $online_users = $users->find("id=$online_user_ids"); // Offline users excluding guest user $offline_users = $users->find("id!=$online_user_ids, roles.count>1");
    1 point
  14. I've come back to this topic myself about 3 years after having a similar need in a different thread. This code, from Tom's activity log module and altered slightly, gets both an old and new version of the page when hooking before saveReady: $clone = clone($page); $this->pages->uncache($clone); $old = $this->pages->get($clone->id); // Now just echo both the fields you are interested in: echo $old->field_of_interest . " becomes " . $page->field_of_interest; exit; On save, that should give you access to the old and new versions of the page where you want to compare just one or a few fields and you know which ones you're interested in already. Seems to simple now when you see the use of clone()
    1 point
×
×
  • Create New...