Leaderboard
Popular Content
Showing content with the highest reputation on 05/03/2021 in all areas
-
Store, collect and update oembed data from external sources. This module uses the great PHP Library Essence by Félix Girault and adds some processwire magic. It is inspired by Ryan's example module FieldtypeEvents and the TextformatterOEmbed module by felixwahner. Thanks! Download & Install Github: https://github.com/neuerituale/FieldtypeOembed Modules directory: https://processwire.com/modules/fieldtype-oembed/ Composer: composer require nr/fieldtypeoembed8 points
-
I'm happy that Selectize.js is getting used more in the core. I should add that we've had the ability to use Selectize.js for page references (multi & single), image tags, and template & field tags since 2016. https://processwire.com/modules/inputfield-selectize/ https://processwire.com/modules/selectize-image-tags/ https://processwire.com/modules/selectize-template-field-tags/ Also if using the module for template & field tags, it tracks all of the tags in the system and provides a selectable list. And it has the option to selectize the icons as well, making it easy to search for icons for any field or template by entering the name of the icon. I've been extensively using all of these modules on all sites. And the inputfield has the additional benefit of allowing custom content for the selectable options as well as the selected options (separately configurable), meaning you can display various fields, icons, or even images on the selectable options. As Selectize.js has been more and more integrated with the core (for example with image tags), the modules have adapted. The Page Inputfields (single, multi) use the core selectize which has the benefit of being customized to work better with the admin. I'll have to see how the module interacts with the the template & field tagging. I think the best option is to allow admins to enable or disable the core init of the template & field tags, so that the module version can continue working, but I haven't tested the latest dev so don't know if it is an option.3 points
-
Hi, A bit of background. I am creating a website which lets you navigate through a protein database with 20 million proteins grouped into 50 thousand categories. The database is fixed in size, meaning no need to update/add information in the near future. Queries to the database are pretty standard. The problem I am currently having is the time it takes to create the pages for the proteins (right now around a week). Pages are created reading the data from a csv file. Based on previous posts I found on this forum (link1, link2) I decided to use $database transactions to load the data from a php script (InnoDB engine required). This really boosts performance from 25 pages per second to 200 pages per second. Problem is performance drops as a function of pages created (see attached image). Is this behavior expected? I tried using gc_collect_cycles() but haven't noticed any difference. Is there a way to avoid the degradation in performance? A stable 200 pages per second would be good enough for me. Pseudo code: $handle = fopen($file, "r"); $trans_size = 200 // commit to database every _ pages try { $database->beginTransaction(); for ($i = 0; $row = fgetcsv($handle, 0, " "); ++$i) { // fields from data $title = $row[0]; $size = $row[1]; $len_avg = $row[2]; $len_std = $row[3]; // create page $page = new Page(); $page->template = "protein"; $page->title = $title; $page->size = $size; $page->len_avg = $len_avg; $page->len_std = $len_std; $page->save(); if (($i+1)%$trans_size == 0) { $database->commit(); // $pages->uncacheAll(); // gc_collect_cycles(); $database->beginTransaction(); } } $database->commit(); } I am quiet new to process wire so feel free to criticize me ? Thanks in advance1 point
-
Ok, that's a solid starting point. I found your other post in within the link to your site here. There is one JavaScript file that might be the problem here - but is just a guess for now. It's located here: yoursite.com/site/templates/js/scripts.js In this script is a part connected to the accordion and its function starting in line 201. //////////////// Accordions /* mr = (function (mr, $, window, document){ "use strict"; var documentReady = function($){ $('.accordion__title').on('click', function(){ var accordion = $(this).closest('.accordion'); var li = $(this).closest('li'); if(li.hasClass('active')){ li.removeClass('active'); }else{ if(accordion.hasClass('accordion--oneopen')){ var wasActive = accordion.find('li.active'); wasActive.removeClass('active'); li.addClass('active'); }else{ li.addClass('active'); } } }); $('.accordion').each(function(){ var accordion = $(this); var minHeight = accordion.outerHeight(true); accordion.css('min-height',minHeight); }); }; mr.accordions = { documentReady : documentReady }; mr.components.documentReady.push(documentReady); return mr; }(mr, jQuery, window, document)); */ As you might already see here the functionality is commented out and therefore disabled (see /* in line 202 and */ in line 236). That would be my starting point for further actions. I wouldn't suggest testing it within the real live website as other things could go wrong. Do you have a testing or development version of your website? Or maybe even better still contact to that agency?1 point
-
Nice, @Zeka I was curious and tried that out ? $langIds = []; foreach($languages as $lang) $langIds[] = $lang->isDefault() ? '' : $lang->id; $field = "title"; $field = "$field.data".implode("|$field.data", $langIds); db($field, 'field selector'); db($pages->find("template=person,$field*=schön")->each('title'), "search 'schön'"); db($pages->find("template=person,$field*=beautiful")->each('title'), "search 'beautiful'");1 point
-
I've opened a request issue for my idea above: https://github.com/processwire/processwire-requests/issues/400 If you like that idea please show your interest by giving it a thumb up, thank you ?1 point
-
As a designer with limited development experience who found PW a few years back, I can say this discussion has been very encouraging to read. PW has enabled me to make functional sites, but this thread opens my eyes to what’s possible. The last thing you want as someone not well versed in the intricacies of programming is leaving a client in the position of being hampered by the original decision in choosing a platform. For instance, anyone with a non-biased eye can see the real pain die-hard proponents of Webflow vocalize on their community forum. It’s come to an impasse. Whether it’s the limitation of the number of custom fields, or of the number of related records one can have, or the speed of queries, or the responsiveness of the dev UI slowing to a crawl because even a small dataset can make building a site laborious. PW eliminates those pain points. The challenge is communicating its value to a wider audience. My forte is communications, strategy, and brand building. So I tend to look at brand voice as part of evaluating a product or service. The great thing is that PW is architecturally sound. Thanks Ryan and everyone for refining it while keeping it true to its ideals.1 point
-
This is what I am using: $this->wire->addHookAfter('ProcessPageEdit::getSubmitActions', function($event) { $page = $event->process->getPage(); if($page->template != "foo") return; $actions = $event->return; unset($actions['next']); $actions['clone'] = [ 'value' => 'clone', 'icon' => 'clone', 'label' => 'Save + create copy', ]; $event->return = $actions; }); $this->wire->addHookAfter('ProcessPageEdit::processSubmitAction', function($event) { $action = $event->arguments(0); // action name, i.e. 'hello' $page = $event->process->getPage(); // Page that was edited/saved if($page->template != 'foo') return; if($action === 'clone') { $copy = $this->wire->pages->clone($page); $copy->title .= ' (copy ' . uniqid() . ')'; $copy->save(); $this->wire->session->redirect($copy->editUrl); } });1 point
-
I've just recoded a brief video where I've tried to explain how to install tailwind inside Processwire ( really badly spoken ? , so be kind...) Moreover I've updated the gist here to reflect the changes I've made since the last time I've written the guide above. There you have it:1 point
-
Thanks for sharing! It is also worth noting the existence of something similar: http://modules.pw/1 point
-
And did you clear your cookies? It's always a good idea to test pw in the browser's incognito mode when strange things occur. That has helped me several times already.1 point