Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/15/2020 in all areas

  1. 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!
    10 points
  2. 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/
    3 points
  3. Works fine for me. In ready.php $this->addHookAfter('Session::logoutSuccess', function(HookEvent $event) { $user = $event->arguments(0); // here, your condition for getting transitory user if($user->id>1025){ // just to confirm wire('log')->save('logged_out',$user->name); // delete the user wire('users')->delete($user); } }); ProcessWire 3.0.159
    3 points
  4. @ryan - fyi...your "dev branch commit log" link above is broken. Great job with all the updates! Looking forward to the FormBuilder updates. Have a great weekend.
    3 points
  5. Do not overwrite the field object (loop item) with the field value. Try: foreach ($page->fields as $field) { $fieldValue = ''; foreach($languageFallback as $languageID) { $fieldValue = $page->getLanguageValue($languageID, $field); if ($fieldValue) break; } $page->$field = $fieldValue; }
    2 points
  6. Lister Selector A Process module that uses Lister/ListerPro, but with a selector string input instead of the normal InputfieldSelector filters. Features For power users, typing a selector string is often faster and more intuitive than fiddling with InputfieldSelector. It also lets you copy/paste selector strings that you might be using somewhere else in your code. Allows the Lister rows to be sorted by multiple fields (not possible in Lister/ListerPro) Allows the use of OR-groups (not possible in Lister/ListerPro) If ListerPro is installed you can run ListerPro actions on the listed pages - the available actions are defined in the module config. Bookmarks can be configured in the module config and accessed via the flyout menu for the module page. For your convenience you can copy/paste a bookmark string from the note at the bottom of the Lister Selector results. Usage Type your selector string on the Selector tab. The selector is applied when the "Selector string" field is blurred, so hit Tab when you have finished typing your selector. Unlike Lister/ListerPro, you can't sort results by clicking the column headings. Control the sort within the selector string instead. Superusers can jump to the module config (e.g. to create a bookmark) by clicking the cog icon at the top right of the module interface. The module is mostly intended for use by superusers, because in most cases site editors won't understand the ProcessWire selector string syntax. If you want another role to be able to access Lister Selector then give the role the "lister-selector" permission. Only superusers can define bookmarks because in ProcessWire module config screens are only accessible to superusers. Screenshots Process page Module config (when ListerPro is installed) Advanced If for any reason you want to create dynamic bookmark links to Lister Selector for a given selector you can do that like this: /** @var $pls ProcessListerSelector */ $pls = $modules->get('ProcessListerSelector'); // Define selector $selector = "template=foo, title%=bar"; // Define columns (optional) $columns = 'title,modified'; $pls_link = $pls->getProcessPage()->url . '?bm=' . $pls->urlSafeBase64Encode($selector . ':' . $columns); echo "<a href='$pls_link'>My link</a>"; https://github.com/Toutouwai/ProcessListerSelector https://modules.processwire.com/modules/process-lister-selector/
    1 point
  7. 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, Chris
    1 point
  8. Came across something strange, maybe anyone of you has seen this before: When I add a new page with template 'simple-page', ProcessWire asks for title and name in order to create the page. I populate the title field and wait for the name field to be filled automatically, i.e.: "Example" for page title and "example" for page name. When I click "Save", the page is being created, loading all other fields for this template. But the fields for title and name are empty again. (And since 'name' is empty, ProcessWire assigns a new name 'untitled' for this newly created page.) Only happens with one template (see structure below) On all new pages with other templates, 'title' and 'name' are assigned just as expected Spotted in ProcessWire 3.0.62, this issue did not appear in an earlier version of the same site using ProcessWire 2.5.3 This is how the template is defined (tidied it up, there's 20+ fields): { "simple-page": { "id": 47, "name": "simple-page", "fieldgroups_id": "simple-page", "flags": 0, "cache_time": 0, "useRoles": 0, "noInherit": 0, "childrenTemplatesID": 0, "sortfield": 99, "noChildren": "", "noParents": "", "childTemplates": [ "special-page" ], "parentTemplates": [ "home" ], "allowPageNum": 0, "allowChangeUser": 0, "redirectLogin": 0, "urlSegments": 0, "https": 0, "slashUrls": 1, "slashPageNum": 0, "slashUrlSegments": 0, "altFilename": "", "guestSearchable": 0, "pageClass": "", "childNameFormat": "", "pageLabelField": "name", "noGlobal": 0, "noMove": 0, "noTrash": 0, "noSettings": 0, "noChangeTemplate": 0, "noShortcut": 0, "noUnpublish": 0, "noLang": 0, "compile": 3, "nameContentTab": 0, "noCacheGetVars": "", "noCachePostVars": "", "useCacheForUsers": 0, "cacheExpire": 0, "cacheExpirePages": [ ], "cacheExpireSelector": "", "label": "Some title", "tags": "", "titleNames": 0, "noPrependTemplateFile": 0, "noAppendTemplateFile": 0, "prependFile": "", "appendFile": "", "tabContent": "", "tabChildren": "", "nameLabel": "", "contentType": "", "errorAction": 0, "ns": "\\", "_exportMode": true, "fieldgroupFields": [ "title", "other_field", "extra_field" ], "fieldgroupContexts": { "title": { "columnWidth": 20, "description": "Put some title here", "label": "Some title" } } } } Any ideas what might cause this issue?
    1 point
  9. Thanks on this! Really look forward on the pull request to go through.
    1 point
  10. The ecumenical city pilgrim trail in Villingen, Germany is a small trail through the city where you can visit churches and other places of interest. This Progressive Web App is a small website to guide visitors through these places and give additional informations. You can install it on your smartphone or tablet and walk the trail with it. app.stadtpilgerweg-villingen.de Features: Interactive Map Progressive Web App Interactive Map Before entering the map you get a little tutorial where you can choose between two routes, the standard trail or a more accessible trail. You can track your position on the map and click on the markers. Each marker is a view with additional information to the place. The views can contain texts, quotes, images or a chat element. The map was realized with Leaflet and styled with Mapbox. Progressive Web App The website can be installed as Progressive Web App on your smartphone or tablet for a better experience. The PWA remembers the last visited view and has no unnecessary browser navigation. It can also partly work offline and caches almost everything. The PWA was realized with the help of Workbox. Modules used: Repeater Matrix ProCache Map Marker (Google Maps) Sitemap ProcessWire Upgrade TOTP two-factor authentification Tracy Debugger Regards, Andreas
    1 point
  11. Example with 'body' field. Define a language fallback order in ready.php and render first match in template. (not tested ... ) // in ready.php $languageFallback = [1046,1042,1033]; // array of Language-IDs in fallback order $body = ''; $pageActiveLanguageIds = $page->getLanguages()->each('id'); $languageFallback = array_intersect($languageFallback, $pageActiveLanguageIds); foreach($languageFallback as $languageID) { $body = $page->getLanguageValue($languageID, 'body'); if ($body) break; } $page->body = $body; // in your template file echo $page->body; // render field body
    1 point
  12. Hello, Just a mention that today I have received this newsletter from The Whale : https://thewhale.cc/91 And Processwire is part of it ?
    1 point
  13. Thanks alot @Juergen! If you wan't to name the button automatically based on the page-table label or the label/title of the allowed templates, use this hook: $this->addHookBefore('InputfieldPageTable::render', function ($event) { $table = $event->object; // Make sure only for fields with a single template… if (count($table->hasField()->template_id) > 1) { return; } // Use the field label… $label = $table->hasField()->label; // or… use the template label or title… $label = $this->templates->get(['id=' => $table->hasField()->template_id])->get('label|title'); // don't miss the use($label part)… $this->addHookBefore('InputfieldButton::render', null, function (HookEvent $event) use ($label) { $button = $event->object; if ('button' == $button->name) { // add label and translatable Add string… $button->attr('value', __('Add') . ' ' . $label); } }); });
    1 point
×
×
  • Create New...