Jump to content


Popular Content

Showing content with the highest reputation on 11/17/2020 in all areas

  1. 9 points
    Licenses on Gumroad. >>> Please include your forum username when purchasing. <<< This is a module pack by Nifty Solutions for Processwire CMF/CMS version 3.0.149 or later (running on PHP 7.2+) that extends the core features for password recovery making them more flexible and easy to use. Features Can send just the verification code in emails (removing the clickable link), and immediately show the reset verification page. This forces the reset to be completed in the same session it was started from. Allow the password reset to be initiated in one session and completed in another. You no longer have to complete the reset from the same browser and tab. There are options to allow you to still require reset completion from the same IP address. Prevention of incorrect data entry in the reset initiation step, users are warned if they enter an email in a username field. Optional customisation of the verification code. Can make manual and/or mouse-based copy-and-paste from the email easier. Optional auto-completion of the verification code field in the password reset step. This makes things easier for users as they don't have to copy-and-paste from their email client. Be warned, however, that this can facilitate automated reset attempts. Control how long reset links are valid for (sometimes an hour is much too long) and update the text of outgoing emails and reset screens to report the new value. Optionally allowing automatic user login following a successful password reset. This is not recommended but is supported. This option is never available to Superusers or users with 2-factor authentication requirements on their accounts. You can additionally limit this to users with specific roles. Allows the reset process to require input of the user's Time-based one-time (TOTP) value - if they have TOTP setup on their account. You can also mandate the entry of a valid TOTP in order to complete a password reset. The TOTP field extends ProcessForgotPassword and operates with or without NiftyPasswordsPlus. Works by extending the core ProcessForgotPassword module so it works on the Admin login page and your custom LoginRegisterPro pages. You'll also get access to NiftyHashedTokens in your template and module files - a HMAC-Hashed key-to-value store, providing tamper-detection of the key and controlling how many times it may be accessed in a given period along with IP address checking. Pre-Requisites This requires PHP7.2 or better and a recent copy of Processwire with the ProcessForgotPassword and InputfieldSelect modules installed. Installation After purchase you will have access to the latest version of the pack as a single zip file.If this is your first Nifty installation: simply unzip the file in a temporary location and transfer the resulting Nifty folder into the site/modules directory of your site. Then refresh the modules in Processwire and install the NiftyPasswordsPlus module.If you already have other Nifty products installed: unzip the file in a temporary location and look in the Nifty folder you unpacked. Copy any new subdirectories from there into your existing site/modules/Nifty directory. Log in to Processwire, refresh your modules and install NiftyPasswordsPlus. You will need to acknowledge the disclaimer, enabling the module in order to proceed. Refunds We offer a no-questions-asked refund policy in the first 14 days from the date and time of your purchase. Settings Step 1: Step 2: Gives options changing how the reset link works. Verification code customisation options: This can lead to much simpler codes in the reset emails... Step 3: If you install FieldtypeUserTOTPValue as well, you also have additional options to require TOTP 2FA for reset. Step 4: Additional settings: FieldtypeUserTOTPValue allows you to add TOTP as a confirm field in ProcessForgotPassword: Which then requires the user doing the reset to enter their TOTP 2FA code (if set on their account) in order to reset their password: If the user does not have TOTP set up on their account, they just leave this blank. If they do have TOTP set up, they need to enter the current value. If you are using this along with NiftyPasswordsPlus, then you can additionally enforce role-based requirements for entry of a correct TOTP value in order for password reset to work. It does this by hooking FieldtypeUserTOTPValue's RequireTfa() method. You can do the same from your site/ready.php file to add any additional checks you'd like for your particular site. We currently only support TOTP 2FA as it is simple, avoids sending another email (in case email is compromised) and the bar to user adoption is quite low. Finally, we have NiftyHashedTokens: Licenses on Gumroad. >>> Please include your forum username when purchasing. <<<
  2. 2 points
    It doesn't look as if Corbel Light is available as a legitimate webfont so honestly you should just explain that to your client. Since it does come with Windows 10 though then a lot of your website visitors will have it installed natively; So you could just use a font-stack with that at the top and then fall back to something similar for users who won't have it - Helvetica isn't a million miles away on a Mac. It'll involve a bit more testing and tweaking but then you could avoid having to load a web font at all (hooray). Just looking at Google Fonts then as @fliwire says Nunito isn't bad or Catamaran looks fairly close too. And just in case you aren't aware of it, the Google Webfonts Helper https://google-webfonts-helper.herokuapp.com/fonts is very handy for grabbing Google Fonts for local hosting.
  3. 2 points
    @monollonom Thanks! I really recommend giving Twig a try, once you get used to it you can never go back 🙃 That's actually an area I don't have a good solution for yet. The problem is that all the template and field configuration lives only in the database, so it's not easy to put under version control. The simplest solution is to include a database dump in the version control, but that is a one-way street. Diverging versions of the database dump are really awkward to merge, so it's impossible for multiple people to work on a project independently and merge their work into one repository later, because they will have different database states that can't really be merged liked diverging versions of source code. Also, it doesn't help with continuous deployment (developing additional feature in a dev environment and updating a live site), because importing the database dump would overwrite the actual site content on the live site as well. The other solution are migration modules like RockMigrations which encode all changes as config files or migration scripts. However, writing those migrations is just so much work, especially with all the field properties which aren't really documented consistently. Mostly it just doesn't feel worth it, especially since it doesn't really solve the problem of multiple people working on a project independently of each other. I'm not even sure if there is a great solution for this. Fundamentally I would prefer if the entire template and field configuration was file-based so it could be versioned. But of course that's a completely different system design.
  4. 1 point
    Hi everyone, I'm happy to present my latest project, which is a collection of guides and tutorials for web development with ProcessWire written by me. https://processwire.dev/ What is this? I have written several tutorials in this forum, and I wanted a central place to collect all my tutorials and put them in a logical order. processwire.dev is exactly that, a curated list of tutorials for different topics related to ProcessWire development. I have revised, updated and expanded most of my existing tutorials. There are also some completely new tutorials. Notable topics How to integrate Composer in your ProcessWire sites, and a general explainer for namespaces and autoloading. A two-part guide to using Twig with ProcessWire and adding custom functionality. How to create flexible content modules with Repeater Matrix fields and Twig. A general guide to performance optimization for ProcessWire. A starter guide for the "ProcessWire mindset" - how to structure your content. ... and much more! What's next? I hope this will be a useful resource to all of you fine people. Please note that these tutorials are very much opinionated, and they reflect my personal experience and development practices. So if you disagree with some of my conclusions, that's perfectly fine! I'm happy to discuss all my recommendations and approaches with you, so let me know if you have any feedback, suggestions or error corrections! I plan to expand this resource over time and already have some new topics planned. If you have suggestions for new topics, go ahead and post them here as well! Start reading now: processwire.dev
  5. 1 point
    One way to do it: <?php namespace ProcessWire; $checkedPagesCount = $pages->count("name_of_checkbox_field=1"); You might want to refine the selector, e.g. limit to a parent or template(s). untested. Edit I see @lokomotivan beat me to it 😁.
  6. 1 point
    $pages->count("checkbox_field_name=1"); 🙂
  7. 1 point
    Thank you for sharing ! I've already had a good read and it's interesting to see your way of dealing with PW. I'm not sure I'm into Twig, but I really like the way you're organising your files and allowing to use composer / nodejs, I'll try that in my next project. I would also be interested to read more about your development flow, like how you deal with git or the transition between local and prod environments.
  8. 1 point
    I've pages using the custom-page-template and I would like to display a simple message at the top of the page form when editing those pages in the Admin. I thought about hooking ProcessPageEdit::buildForm() but I do not well how to use that hook in order to display the message just for the custom-page-template pages. Any help? UPDATE: Solution found wire()->addHookAfter('ProcessPageEdit::buildForm', function(HookEvent $event) { $ProcessPageEdit = $event->object; $form = $event->arguments('form'); switch ($ProcessPageEdit->getPage()->template->name) { case 'custom-page-template': $form->prependMarkup("<div style='margin-bottom: 3.6em; margin-top: 1em; background: #ffd;'>MY MESSAGE</div>"); break; default: // do nothing } }); Any improvement is welcome!
  9. 1 point
  10. 1 point
  11. 1 point
    Thank you so much Moritz. This is even longer than I expected 😄 It sounds like the perfect solution for this and will definitely be my long-term goal – maybe even with the possibility to restrict the visitors location to a country or region. I know and use the modules you mentioned, on the other hand – please don't laugh – I've never worked with hooks yet. This is new and I'll need some time to try that 😕. One thing got missing here and this probably makes it even simpler. The ticket codes come from an official ticket service where people buy real tickets for real concerts. So for this I won't have to generate codes on request/order and handle payments. So I will (or my customer) most likely have to import or copy/paste these codes. I have to check but I think the gag would be to enter the «online concert venue» with only a code and without a user account or name/password. So I will have to try to store the code along with the visitors IP address in the codes table. I will get back here and post my solution or further steps or questions.
  12. 1 point
    Looks great - thank you for putting this together. Looking forward to reading through these.
  13. 1 point
    Chäs & Co is a b2b cheese trader. They love good cheese and are proud of their excellent knowledge und connections to small cheese producers. They maintain a custom made database and used to copy/paste (!) the cheese infos to the former CMS (Contao). Since substituting the database with ProcessWire was no option, they export now the database to a csv file and import it to the new website (expanded version of module ImportPagesCSV). From there, the pw magic begins. The staff works with the admin interface: They search and find products in notime using the build-in search field (using cheese names or id. Using ids only possible by adding hook, see this forum thread). They generate price lists easily based on a template, providing checkboxes and option buttons for some restrictions, choose i.e. the cheese origin and price audience (all implemented as page selectors). By saving the page a PDF list gets generated (using mpdf, a php pdf library). The visitors can sort and filter the products using a form by shuffle.js. Product details are shown in a popup (fancybox). There's also the option for generating a nice pdf data sheet. No CSS framework being used. Other modules used: ProcessJumpLinks, ProcessProMailer, ProcessWireUpgrade. Visual design: Nicole Haller
  14. 1 point
    Did I already say that I love PW? 😄 I had to write an offer today and I wanted to link to a portfolio website that I've built, but the link was too long for the PDF. Then I wanted to use one of the url shortening services, but it felt wrong to put a link like bit.ly/409weifsd on my offer. I then just enabled UrlSegments on my website's home.php template, added a repeater with fields "title" and "link" and put 5 lines of code to get my very own custom short-links: $shorturl = $sanitizer->text($input->urlSegment(1)); if($shorturl) { $link = @$page->shorturls->findOne("title=$shorturl")->link; if(!$link) throw new Wire404Exception(); $session->redirect($link); } If you want to try it out: https://www.baumrock.com/pw-demo Any suggestions for improvements are welcome 🙂
  15. 1 point
    Hi darrenc, Your project sounds perfect for Pw (and vice versa ). For the site-structure: I suggest to look at kongondo's excellent tutorial here: http://processwire.com/talk/topic/3579-tutorial-approaches-to-categorising-site-content/ Bookmarking: I would just store the ids of the products a visitor has bookmarked in the session. On the review-page, display them together with a form and send the data to the client afterwards. Some pseudo code: // in template product // .... // Check if this product was bookmarked, e.g. on top of the product template if ($bookmark = $input->get->bookmark) { $bookmarks = ($session->bookmarks) ? $session->bookmarks : array(); $bookmarks[] = (int) $bookmark; $session->bookmarks = $bookmarks; } // this is the link to bookmark the actual product <a href='<?= $page->url; ?>?bookmark=<?= $page->id; ?>'>Bookmark me!</a> // in template review if (count($session->bookmarks)) { foreach ($session->bookmarks as $b) { echo 'You bookmarked ' . $b->title; } } else { echo 'no bookmarks'; }
  • Create New...