Leaderboard
Popular Content
Showing content with the highest reputation on 02/14/2022 in all areas
-
This week I've bumped the dev branch version to 3.0.194. Relative to last week, there are a few commits fixing minor issues. Last week we covered some fairly major updates and I've not come across any concerning side effects, so figured it's a good day to bump the version. Next week my kids are out of school for winter break so I'll be around but I don't expect I'll have much in terms of updates to report next week, but definitely will the following week. Thanks and have a great weekend!3 points
-
Hi, I want to share an easy way to use Stripe Payment Links in processwire website: 1) Upload folder 'stripe-php' in site/templates (attached) 2) Upload file init.php in site/templates (attached) 3) Use variables in template 'product': $xxx = $page->prezzo_interno; $session->set(prod, "$page->title"); $session->set(price, $xxx); 4) Insert a form in the template 'product' 5) Copy ApiKey in Stripe Account 5) Create a template 'checkout' and copy Apikey <?php //include './stripe-php/init.php'; include 'init.php'; //require 'vendor/autoload.php'; Stripe\Stripe::setApiKey('xxxxxxxxxxxxxxxxxxxxxxxxxxxx'); header('Content-Type: application/json'); $YOUR_DOMAIN = 'https://www.dominio.it/'; $checkout_session = \Stripe\Checkout\Session::create([ 'shipping_address_collection' => [ 'allowed_countries' => ['IT'], ], 'shipping_options' => [ [ 'shipping_rate_data' => [ 'type' => 'fixed_amount', 'fixed_amount' => [ 'amount' => 500, 'currency' => 'eur', ], 'display_name' => 'Standard', // Delivers between 5-7 business days 'delivery_estimate' => [ 'minimum' => [ 'unit' => 'business_day', 'value' => 5, ], 'maximum' => [ 'unit' => 'business_day', 'value' => 7, ], ] ] ], [ 'shipping_rate_data' => [ 'type' => 'fixed_amount', 'fixed_amount' => [ 'amount' => 800, 'currency' => 'eur', ], 'display_name' => 'Celere', // Delivers in exactly 1 business day 'delivery_estimate' => [ 'minimum' => [ 'unit' => 'business_day', 'value' => 1, ], 'maximum' => [ 'unit' => 'business_day', 'value' => 3, ], ] ] ], ], 'line_items' => [[ # Provide the exact Price ID (e.g. pr_1234) of the product you want to sell 'name' => $session->get(prod), 'amount' => $session->get(price), 'currency' => 'eur', 'quantity' => 1 ]], 'mode' => 'payment', 'discounts' => [[ 'coupon' => '1', ]], 'success_url' => $YOUR_DOMAIN . 'grazie/', 'cancel_url' => $YOUR_DOMAIN . 'pagamento-rifiutato/', ]); header("HTTP/1.1 303 See Other"); header("Location: " . $checkout_session->url); .. and that's it! I hope it could be useful for everybody here! Bye Archivio.zip1 point
-
This module enables Selectize (which is bundled with the PW core) on all Select and AsmSelect inputfields in the PW admin. As described below in the readme, Selectize is initialised/destroyed as the revelant select is focused/blurred in order to support select options that change after the page is loaded. Therefore Selectize is styled to match the AdminThemeUikit select as closely as possible to minimise the visual change as the select is focused and blurred. I'm developing on Windows so I'm not sure how the module will render on other operating systems. It doesn't help that the PW admin uses different fonts depending on the OS - I wish PW would bundle its own webfont for a standardised appearance everywhere. Incidentally, I was a bit disappointed with the state of the Selectize project. I had to fix or work around a number of bugs and shortcomings, including things you would think would just work out of the box such as disabled options, matching the width of the replaced select, or the standard select behaviour where a selection is required when there is no empty option. The Selectize issues repo is full of arbitrarily closed bug reports and pull requests and there are no updates for the last 6 years. I've tried to catch everything that would affect this module but I wouldn't be surprised if there are still some bugs. Selectize All Enables Selectize on all InputfieldSelect and InputfieldAsmSelect fields in the ProcessWire admin. The module activates Selectize on the <select> element when it is focused, and destroys Selectize when the element is blurred. This allows Selectize to work on selects where the options are changed dynamically after page load depending on other field values, e.g. the "Select File" field in the CKEditor link modal or a dependent select in Page Edit. Only AdminThemeUikit is tested and supported. Usage In the module config you can choose if Selectize should be used with InputfieldSelect, InputfieldAsmSelect, or both. If you want to disable the module for a specific Select or AsmSelect inputfield you can hook SelectizeAll::allowSelectize. This method receives the Inputfield object as the first argument. Example: $wire->addHookAfter('SelectizeAll::allowSelectize', function(HookEvent $event) { $inputfield = $event->arguments(0); // You can also get any associated Page and Field objects via $inputfield->hasPage and $inputfield->hasField // Disable the module for the inputfield named "template" if($inputfield->name === 'template') $event->return = false; }); https://github.com/Toutouwai/SelectizeAll https://processwire.com/modules/selectize-all/1 point
-
Natasha Marques is a desserts chef and chocolatier from Brazil with an international carreer. Now established in my hometown Porto, she's about to open a shop and already shipping her premium line of sweets and desserts. The website is my usual combo of PW with StencilJS frontend with a content blocks approach. Minimal stack of modules: SeoMaestro, WireMailSmtp, and my own block selector module which is a hacked version of FieldSelectFile. The site is only in portuguese, but have a look anyway: https://arbynatashamarques.com/1 point
-
This week we have some great performance and scalability improvements in the core that enable lazy-loading of fields, templates and fieldgroups, thanks to @thetuningspoon — https://processwire.com/blog/posts/field-and-template-scalability-improvements/1 point
-
Thanks @Robin S. I guess I mis-read 'allows selectize' - meaning 'stops selectize messing with'. Anyway, I can confirm that the module works nicely with my hook. (Maybe I also thought, given what a clever person you are, that you had bundled server-side select options, via AJAX, but clearly I was over-reading it).1 point
-
I have found a solution, but you have to hack the core file "ProcessLanguage.php"a little bit. The perfect method to save translations to fields created by a module is to hook after the "processCSV" method of the "ProcessLanguage" class file. Only problem: This method is not hookable by default, so I added 3 underscores to the method name to make it hookable. Goal: I want to add the German labels to the 3 fields created by the module after uploading and saving the translation csv file for this module. The label translations are inside the module translation csv file and I need to save it to the 3 fields. This is the main problem, because this field were created by the module but they are not part of the module, so I have to create/save the translations for this fields in an extra step. They will not be saved by adding the translation file to the module by default. To save the labels of the fields in another language I use the method below: // Define the hook function inside the init method public function init() { $this->addHookAfter('ProcessLanguage::processCSV', $this, 'addTranslationsToFields'); } /** * Method to add translation to the labels of fields created by this module * @param HookEvent */ protected function addTranslationsToFields(HookEvent $event){ // get the language object of the uploaded translation csv file $language = $event->arguments(1); $translation = new LanguageTranslator($language); $fields = ['jk_publish_open', 'jk_publish_from', 'jk_publish_until']; // name of the field to translate the labels foreach($fields as $fieldName){ //grab the field object $field = $this->wire('fields')->get($fieldName); $label = $translation->getTranslation($this, $field->label); $field->set("label{$language->id}", $label); $field->save('label'); } } The 3 fields where I want to add the translations to the labels are called 'jk_publish_open', 'jk_publish_from', 'jk_publish_until'. After uploading the translation csv. file for the module, the translations for the labels will be also added to the extra created fields which are not part of the module. This works like a charme (thanks to the PW LanguageTranslator class). I will try to convince Ryan to make the processCSV method hookable by default. Therefore I have submitted a pull request for making this method hookable by default: Best regards1 point
-
You don't have to implement anything, it's just stating the fact that the module initialiases Selectize when a select field is focused and destroys Selectize when that field is later blurred. And the reason this is done is to support any scenario where options are changed by JavaScript after the page loads. If Selectize was initialised the "normal" way (only once when the page loads) then it wouldn't work correctly after the options changed.1 point
-
I have to agree with you. It feels a bit weird to me, specially the "AR" part, which translates to "air", but I tend to read it as A.R. But that's the brand, and it already existed before the website. The domain name too, was already running with a not very good wordpress. Good thing is, as she came over to deliver some of her products, she commented that she already had some contacts coming from the site and that wasn't happening before. We haven't even started promoting it other than me sharing it on twitter, so this is great news.1 point
-
Hi @joe_g Try add check_access=0 to your selector. https://cheatsheet.processwire.com/selectors/built-in-page-selector-properties/check_access-0/ Gideon1 point
-
1 point
-
Give the latest version a go. There was one other place that needed the isLocal check removed.1 point
-
Thank you very much for your help @bernhard, it turns out the Setup Page Name module does what I want to do.1 point
-
Great! ? OMG, when reading your last answer, I finally got that GIT is used (responsible) for the merging-magic. Ok, that makes it look to me in another light. ?️ The whole time I assumed that there (at least additionally) must be some sort of importer in the CMS which has to deal with all the heavy stuff (conflicts and edge cases, etc). But now, its all good. ?1 point
-
https://www.kaumberg.gv.at/ Hello everybody! Today I want to share a project that I've been working on for a year or so: The new website for municipal Kaumberg - a beautiful village near Vienna. To be honest, this project was way more work than I initially expected. The site has tons of content and the client came with lots of good ideas during the process of building this site. For example after we launched the site several organisations of the village realized that the system works great and is easy to use, so they wanted their own section with their own color scheme... Right now the system is maintained by several user accounts that populate content to the site. Some of them only in the news-section, others are allowed to publish to the sub-sites (eg for the fire department). Recently we won the 2nd price out of 190 cities in lower austria - where Kaumberg was by far the smallest one also having the smallest budget of the top rated cities! ### NOTE ### This system was built with scalability in mind. If you know any other municipals (preferable in a german speaking country) that could possibly need a new website using my setup write me a PM. If you are a marketing guru and know how we can sell this product to 100s of municipals, let me know. I know how to do that from the technical point of view ? ### HIGHLIGHTS ### CONTENT Custom multi-level menu for managing loads of content pages that also works well with keyboard navigation ? --- EVENT MANAGEMENT Events are managed via the PW backend and presented as calendar on the website plus can be downloaded as PDF calendar in A3 format for printing: --- CONTENT BLOCKS I've developed a new (private) module called RockMatrix for versatile, easy and fool-proof content creation for this project. This setup ensures that even non-tech-savvy users can create content that looks nice and works on all devices from desktop to mobile: --- SITE SEARCH Another new module that was developed for this project is RockSearch. I hate site searches that do work on the first sight but do not on the second. For example if they show older results on top of newer ones. Or if they do not index content that is not stored within a regular text field but for example as image description. On the other hand I did not want to use ElasticSearch because it seemed to be overhead to send data to another service that is already stored in the database of my PW installation... RockSearch shows results based on different weighing mechanisms, for exampe a search for the garbage collection schedule first shows results that are nearer to the current date than others (both future and past). That means that a date two days in the future will be shown above one that is 10 days in the past. Also results get different score based on where the term was found - matches in the site title get higher scores than matches in the body or in image descriptions or the like. Each content block is a RockMatrix block that has a render() method to define the output on the website and - for RockSearch - has a method called "searchIndex()" that defines the content that is written to the search index that is queried for every search request: This setup makes it super easy to add new content elements and to add them to the search index ? --- SUB-SITES The client can create sub-sites for different organisations of the village having custom color schemes and managing user access: News can be tagged to show up on different areas of the website: --- OTHER The site uses no cookies and can therefore be used without an annoying cookie banner. Page hit statistics are gathered by PageHitCounter and shown by RockHitCounter Some other little features are short-links for social media (eg https://www.kaumberg.gv.at/goto-1027 ) or the possibility for creating custom subdomains for sub-sites like http://araburg.kaumberg.at/ I'm quite sure I forgot lots of great stuff, but I hope you enjoyed reading this article nevertheless ? Looking forward to your feedback!1 point