Leaderboard
Popular Content
Showing content with the highest reputation on 08/14/2020 in all areas
-
All has gone smoothly with the new master branch version of ProcessWire (3.0.164), officially released last week. Next week we’ll also be releasing 3.0.165 on the master branch, which will fix a couple minor issues that have surfaced. Though we are talking very minor, so there’s no reason to wait on upgrading. The dev branch commit log covers changes since 3.0.164. There will be more commits next week and then we’ll be on version 3.0.165 on both dev and master branches. This week, in addition to some minor core updates, I’ve been working on updates for both ProCache and FormBuilder. The ProCache updates primarily focus on providing better API functions for finding what’s cached, adding more hooks, and providing better control over when and how cached versions of pages originating from URL segments are cleared from the cache. On the FormBuilder side, I’ve been focused on improving our submitted form entry listing tools for the admin side. Prior to the version in progress, it hasn’t been possible to perform custom searches on submitted form entries, the way that you might do in Lister/ListerPro for pages. Nor has it been possible to sort by anything other than created or modified date. That all changes in this new FormBuilder version. Now you can search within and sort on any field in the entries listings. You can search and filter by any number of fields at once. You can select what fields/columns display, and in what order. You can export (CSV) rows that match your search criteria. It’s basically like a mini ListerPro, but for forms submitted on your site. So far I’m finding it extremely useful in testing here, and I'm excited to release it in the FormBuilder support board. Below is a screenshot. I should have this version released in the FormBuilder board in 1-2 weeks, along with some other updates to it. Thanks for reading this quick update and have a great weekend!7 points
-
With 5 million pages do people actually click through who knows how many pages you get? Generally offset/limit pagination scales quite badly because it always needs to count the offset part as well. So the higher the page number (offset) the slower the query will get. For big datasets cursor based pagination is usually adviced, but on processwire you‘d need custom sql for that. Also it will no longer give you pagination in terms of „you‘re on page 6043 of 20383“. You can only do next/prev. But from an UX pov page numbers that big aren‘t useful in the first place. Having means of filtering down to a more manageable result set is what I would rather strive for.5 points
-
4 points
-
Render oEmbed data from YouTube/Vimeo URLs... or TextformatterVideoEmbed for power users. https://github.com/nbcommunication/TextformatterVideoMarkup The use case... On an upcoming project, we want to be able to render YouTube/Vimeo URLs as thumbnail images, that when clicked open up in a (UIkit) lightbox. Additionally, we want to be able to specify the thumbnail image - as part of a RepeaterMatrix block which contains a URL field (video) and an Image field (thumb). The result is this module, which allows you to specify the markup used to render the oEmbed data: The formatter can be used on any Text field e.g. Text, Textarea (CKEditor or not), URL etc. Global configuration options are available (e.g. rel=0), based on TextformatterVideoEmbedOptions. An 'empty value' can be specified for URLs that do not return data from the oEmbed endpoint The render method is hookable, allowing you to customise rendering on a per page, per field basis Plenty more information here ? https://github.com/nbcommunication/TextformatterVideoMarkup/blob/master/README.md Back to the use case... How do we render the thumbnail and then use the image from our Image field? In the module config Markup field: <figure data-uk-lightbox> <a href="{url}" data-poster="{thumbnail_url}" data-attrs="width: {width}; height: {height}"> <img src="{thumbnail_url}" alt="{title}"> </a> </figure> Then in site/ready.php <?php $wire->addHookBefore('TextformatterVideoMarkup::render', function(HookEvent $event) { // Arguments (for info) $tpl = $event->arguments(0); // string: The markup template $data = $event->arguments(1); // array: The oEmbed data $url = $event->arguments(2); // string: The requested URL $emptyValue = $event->arguments(3); // string: The empty value used if no data is returned // Object properties (for info) $page = $event->object->page; // Page: The page $field = $event->object->field; // Field: The field $html = $event->object->html; // bool: Is it HTML being parsed, or plain text? // Replace the thumbnail image if($field->name == 'video' && $page->hasField('thumb') && $page->thumb) { $data['thumbnail_url'] = $page->thumb->url; $event->arguments(1, $data); } }); The module requires PW >= 3.0.148 and PHP >= 7. It probably doesn't need to, but the expectation is that power users will be able to meet these requirements! The module is also Beta - please don't use in production yet. I suspect there will be edge cases related to the changes I made to the URL regexes from TextformatterVideoEmbed - so far though they are working for me. If you come across any issues please let me know! Cheers, Chris2 points
-
Looks neat and has JS components which is promising, but needs more variables as the document states and more JS components (no tabs, no accordion, etc.). I'll be following this. UIkit is tough to beat however.2 points
-
I'm not really sure what you're asking. The above DIV- and SPAN-soup is certainly not a product of the official CKEditor plugin. CKE uses regular, semantic table, th, tr, td etc. tags. And with semantic tags, you don't need any ARIA or schema.org stuff. Where's that code-block from?1 point
-
Foud the solution: ini_set("xdebug.var_display_max_children", '-1'); ini_set("xdebug.var_display_max_data", '-1'); ini_set("xdebug.var_display_max_depth", '-1'); Source: https://stackoverflow.com/a/34342948/23388291 point
-
I guess you could disable counting in your selector and get the count of matching pages separately via $pages->count() on the first page only. Then pass the count in the query string (or store it in $session) and use PaginatedArray::setTotal() to set the total count to the PageArray on each pagination. And if necessary you can fake the pagination entirely as shown by Ryan here:1 point
-
Thanks for alerting me to this. In v0.1.0, if you didn't supply a limit as part of the selector string then all the matching pages are listed, which strictly speaking is the correct result. But it seems that Lister doesn't expect this scenario and renders pagination numbers as if a limit of 25 was supplied. Clicking these numbers doesn't do anything though because actually all the pages are already listed. But I think for most cases it's best to for Lister Selector to apply a default limit of 25 if none is supplied in the selector string - that way it's more in line with how Lister and Lister Pro behave. So I've changed to this in v0.1.1. And if you want a different limit you can supply it in the selector string (and you can use limit=0 if you want to see all results at once, but be aware that Lister will then render the incorrect pagination once again).1 point
-
Hey Thomas, first of all: thanks for your all the effort you put into the RestApi Module. I've seen the AppApi Module recently and I think it would be good to focus on it. keep it up.1 point
-
Hey everyone, there is a new module AppApi available which is based on my original RestApi module but has some additional features which are really cool! I have been struggling to find time for the RestApi module over the course of the last 1+ year, so I'm really glad @Sebi is stepping in and doing work in this area. I think it would be a good idea, to see AppApi as a successor of the RestApi module and put all focus and development efforts there. What do you guys think?1 point
-
1 point
-
Very easy to beat ? https://arnaudleray.github.io/pocketgrid/ Don't need prepacked buttons, forms, sliders, rounded-corners, cards, whole shebang ..... I only need something to be there the moment I need it. Neither do I need css overrides or cryptic chained classes ....1 point
-
Interested in updates on how deep any of you went with Shopify PW integration. Like: What were the edge cases? How did you deal with users and auth? Did you set up CRUD for products directly in PW admin directly? Just finished one Shopify site and starting work on another, OMG the content management outside products in Shopify is a complete and utter disaster. I am really reticent to build this new store as a shopify theme simply because of how broken Shopify content management is... even the upcoming sections everywhere architecture seems wrong to me in lots of ways. Here are some of the more interesting things I have found: https://github.com/sellfino/sellfino Self hosted open source App Store with a content builder app that from my research is the only shopify app anywhere that offers a flexible content field (a la Repeater Matrix). https://github.com/ctrl-alt-del-world/midway Gatsby stater for shopify + https://www.sanity.io. Sanity is an amazing product with very attractive pricing but I wouldn't touch Gatsby with a 10 inch pole. https://saleor.io Seems very mature and capable but the massive install freaked me out since I have never used Django nor python much besides writing my own little sublime plugins. I can't really tell if this is meant for smaller merchants or massive enterprises. https://github.com/panoply/shopify-sync If you are developing a shopify theme this is a great little node syncing library so you can drop themekit and run whatever build system you like. Works a treat.1 point
-
1 point
-
The site hasn't been on ProcessWire for some time, but payment processing was all done "offline". The advertising packages were just pages that had associated prices. I believe I have a page structure called "Advertising Subscriptions" that had a single-select user field, a single-select advertising package field, and a start and end date. This is the PW equivalent of join table (is that the right word?).1 point
-
Hi there. It's hard to provide specific instructions without knowing a bit more about your site – for an example whether you've installed a publicly available site profile or developed a custom one yourself – but you can check the page number in a template file and only show the header if the user is currently viewing page 1: <?php if ($input->pageNum == 1): ?> <!-- your header goes here --> <?php endif; ?> More details here.1 point
-
I have a sudden problem with this module. The "Image extra fields" don't show up any more. Not on the Edit Page template, nor on the published page itself. There is the caption field enabled and two extra TextInputs. (see the attached image_extra_field_details.png) but they are not visible. I have done this page for a library more than a year ago and they used it without a problem since then. On the Page > Home -> Content -> Edit (an item) which uses this module: there is only the image and a description field (like a normal image field) the other TextInputs are simply gone. (see the image_extra_field_page_edit.png). Nobody has changed anything what so ever, I have checked the logs to be sure. The page uses the Image Extra Module 1.0.0 and ProcessWire version 3.0.27 Any idea what the reason could be? Thanks for any feedback. P.S. When I enable debug mode the only notice I get is : Undefined index: vitrineimages in /home/bla/public_html/wire/modules/ImageExtra.module on line 826 but no error The Admin->Modules->ImageExtra->Module information page shows: Title Image Extra Class ImageExtra File /wire /modules /ImageExtra.module Version 1.0.0 Installed 1 year ago Summary Adds custom fields to image fields (including multi-language support) Hooks To after.InputfieldImage::getConfigInputfields(), after.InputfieldImage::renderItem(), before.ProcessField::executeSave() More Information https://github.com/justonestep/processwire-imageextra1 point
-
There is an option for changing the "created" date via the API using quiet mode: $page->created = $timestamp $page->save(array('quiet' => true)); This only works for created though, not modified. This is what I use for modified - make sure you do this after the last $page->save() or it will be overwritten. $sql = "UPDATE `pages` SET `modified` = '".date('Y-m-d H:i:s', $timestamp)."' WHERE `id` = '".$page->id."';"; $update = wire('db')->query($sql);1 point
-
There's another method to be able to overwrite created user directly when creating a page. There's a new template setting to allow overwriting the $page->createdUser that you can enable to allow this via API. Then you can do this: $p = new Page(); $p->template = "basic-page"; $p->set("createdUser", wire("users")->get("importer")); $p->title = "Imported page"; $p->save();1 point
-
Another edit deserves a new post... I noticed that the previous approach didn't work in some situations where last row wouldn't have any page to populate it (on the first screenshot there is an example with 7 rows and 23 pages). I'm not very good at maths, but I thought that, knowing the mod we could distribute the pages in another way. So, here is the new code with the changes commented: $rows = 7; $totalCount = count($jurisdictionsPageChildren); $rowCount = ceil($totalCount / $rows); $mod = $totalCount % $rows; // this will tell us how many rows will have more pages than the others $firstInRow = 0; $i = 1; while ($i <= $rows){ $mainContent .= "<div class='columns six"; if($i == 1) $mainContent .= " alpha"; if($i == $rows) $mainContent .= " omega"; $mainContent .= "'>"; if($i <= $mod){ // do this when we want one more page on the row $sliced = $jurisdictionsPageChildren->slice($firstInRow, $rowCount); $firstInRow += $rowCount; }else{ // do this when we want one less page on the row $sliced = $jurisdictionsPageChildren->slice($firstInRow, $rowCount-1); $firstInRow += $rowCount-1; } foreach($sliced as $p){ $mainContent .= "<h2><a$class href='{$p->url}' title='{$p->title}'>{$p->title}</a></h2>"; } $mainContent .= "</div>"; $i++; } and on the other screenshots, the working version1 point