Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/04/2024 in all areas

  1. In the last couple of weeks I’ve been to several cities in Spain, France and Italy. I’d never been to any of those countries before (or Europe for that matter), so it was an exciting trip. Though the goal was for my kids to broaden their horizons and experience other parts of the world, as well as spend time with my parents and family. We got back this week and have been recovering from jet lag (another thing I’d not experienced before). The 6 hour difference was no problem getting there, but coming back, it’s a little harder to adjust! Next week I turn 50 years old (ugh), and then the following week I’m back in Europe again, except this time in the Netherlands on a bike trip with a client, and without my kids and parents. I’m not sure I’ll be able to do many core updates during the 10 day trip but do expect to have internet access this time, so will at least be online regularly and hope to be here in the forums. After that trip, I won’t be traveling again for a long time, and the focus will be on getting our next main/master version out. I noticed this week that @Robin S is now beating me as our most prolific module developer, with 72 modules! Great job and thanks for all the great modules Robin S.!
    23 points
  2. 5 points
  3. This is not really a tutorial, but simply a little trick. I was trying to work on an enhancement for @adrian's module ModuleSettingsImportExport but hit a slight roadblock. For a configurable module I wanted to get the class of an inputfield (set in getModuleConfigInputfields). However I could only see how to get its value, not any way to get the object itself. I did a lot of searching without any result. Then I realised that you could do it like this: // $module is the module we are interested in (check it is configurable) // $fieldName is the name of the config inputfield $wrap = new InputfieldWrapper(); $module->getModuleConfigInputfields($wrap); $field = $wrap->get($fieldName); // $field is the inputfield object for $fieldName Might be of use to someone (if only me when I come across it again 😉)
    2 points
  4. @ryan Happy upcoming birthday! Great to see that you're getting some travel in! M'dude, you're going to be in the Netherlands. The core can wait IMHO 👍 We had a great time when we last visited, enjoy! @Robin S doing the lords work 🙏
    2 points
  5. Welcome to the 50s. And nice to know that @Robin S is so prolific. I sometimes get asked by clients what happens if I have a collision with a proverbial bus, and it's a really good selling point to be able to say there's another Kiwi (what we New Zealanders call ourselves after our national bird - not a fruit) who's a major contributor to the system I use for most of my sites, and who's also developed some quite high profile national sites with it. I suppose I should get a move on and write some modules, but I guess it's testimony to the ProcessWire ecosystem that I haven't needed to as yet (well I have, but they're for specific client business processes, so not something I can release publicly.) Speaking of broadening horizons and geography, even though Robin is on the same island as me, we're at opposite ends, and he's at least a 12 hour drive away. I know I shocked my mother-in-law when she came here, because her idea of an island was that there'd be sea all around, and I took her on a trip that involved very full days with 3 or 4 days without ever seeing the coast.
    2 points
  6. Glad you're having a good time on our continent, Ryan! Nice choice! It is so cool you are about to celebrate your first half of a century! Seems like you're having a great life so far. But you didn't have all those 50 years to work on PW pitifully, as you had to spend time on childhood and etcetera. Your next half centuries you won't have this excuse))) So waiting for the things to come! Congratulations to @Robin S! Your modules really make the ecosystem a place to thrive! Thank you!
    2 points
  7. Here's a site from someone new to ProcessWire. I've been developing with PHP and WordPress for donkeys years, but decided to try building a site with PW to see if it might be a better platform choice for the kind of sites and apps I build these days. Spoiler alert: it is. https://www.eltikon.online/ I'm not holding this site up as any kind of design example - it's a really, really basic hobby blog. What's more important to me is that I managed to build it from scratch in PW (previously it was a WordPress site) in about 20 hours, starting with zero PW experience, and my templates folder is really tidy with just a few small, well-structured PHP files. And that 20 hours includes sorting out the RSS feed, the XML sitemap, the SEO, etc etc. So my reason for posting is really to say that I found the PW architecture and methodology instantly comfortable and intuitive, and PW is going to be the first platform I consider for most future builds. It fits with my "hate visual builders, love coding" methodology, and I aim to get the ProFields Repeater Matrix module, since Advanced Custom Fields Pro's flexible content field has been at the core of all my WordPress sites for ages. Site details: I started with a clean install of PW 3.0.229 and the "site-simple-blog" site profile by tcnet, which I proceeded to completely rip apart and rebuild as part of the learning process. Non-core modules installed are SeoMaestro and ProcessPageViewStat, nothing else.
    2 points
  8. This module allows you to add Cloudflare's Turnstile CAPTCHA to your website, providing a user-friendly alternative to Google's reCAPTCHA. It is based on MarkupGoogleRecaptcha, allowing for easy switching between the two CAPTCHA systems. If MarkupGoogleRecaptcha is installed, some of its settings are used to configure Turnstile. https://github.com/nbcommunication/MarkupCloudflareTurnstile We've used reCAPTCHA for many years now but have found that it isn't as effective as it should be in reducing spam. It is also pretty annoying. We've recently switched a couple of our 'bigger' sites to use Turnstile (using this module) as the sites were on Cloudflare already. It is definitely a much friendlier captcha for users, still to determine whether it is better at preventing spam, but I expect it will be. Cheers, Chris
    1 point
  9. I had to use composer to install it. The module folder created is different from the earlier one. Worked as expected. Thanks.
    1 point
  10. Got the idea and it works. Thank you very much!
    1 point
  11. Hi @Edward Ver Welcome to the forum and the world of ProcessWire. Please try the following code. Please note the comments to see if you get the idea. <?php $showcase = $pages->find("template=work_details") ?> <?php foreach($showcase as $showcases): ?> <div> <?php foreach($showcases->work_hero_repeater as $whr): ?> // You need to loop therough the repeater because repeater is an arrray. <p class="pb-2 text-left"><?= $whr->work_hero_subheading ?></p> // Then call the field in the repeater item as you need" <?php endforeach; ?> </div> <?php endforeach; ?> Gideon
    1 point
  12. I see, you have the old version. Update to the latest one (2.0.0).
    1 point
  13. Inputfield Dependency Helper Adds "Insert field name" and "Insert value" dropdown menus to help with constructing show-if/required-if conditions, aka inputfield dependencies. The "Insert field name" menu helps you remember the field names that exist in your site (or exist in the current template) and avoids typos. The "Insert value" menu lets you select values for Page Reference or Select Options fields via the human-friendly label whereas the show-if/required-if conditions require those values to be inserted as numerical IDs. Insert field name When you click the button a dropdown menu appears listing field names, with the field labels in parentheses. When editing a field in template context only the fields that exist in the template are listed, and the field labels are in template context. When editing a field outside of template context all the non-system fields are listed. When you click an item in the list the field name is inserted into the settings field. Insert value When using a Page Reference or Select Options field value in a show-if/required-if condition you have to enter the numerical ID of the page/option, and this is not so user-friendly – often you have to switch to another tab and go and look up the relevant ID. The "Insert value" button is intended to make this process easier. When you click the button a dropdown menu appears listing any Page Reference and Select Options fields that exist in the current template (when editing in template context) or in the site. When you click one of the fields the selectable options for the field are AJAX-loaded into a flyout menu. Clicking one of the selectable options will insert the numerical ID of the option into the settings field. Configuration In the module config you can set a limit to the number of selectable options shown in the menu, so the menu doesn't get excessively long. https://github.com/Toutouwai/InputfieldDependencyHelper https://processwire.com/modules/inputfield-dependency-helper/
    1 point
  14. I am so grateful to @bernhard and @FireWire for all the excellent tips and tutorials on how to use better tools to code better website (Latte + PageClasses). Thanks a lot guys for you hard job, I've learned a lot from you. After this little intro of gratitude, I have a question on how you would use the templates available in Latte in conjunction with PW templates. I am referring to templates or block in latte, here https://latte.nette.org/en/template-inheritance#toc-definitions so for example I can crate a button tag inside a .latte file, like "components.latte" and import these bits of code, or "function" inside other .latte files. All this is very nice and useful. But now my question is: is it possible to import a latte block inside a normal processwire.php template? In other words: if I'm in // templates/blog-post.php <?= $rockfrontend->render('components/blog.latte', [// How can I fetch the block tag?]) ?> // templates/components/blog.latte {define tagLabel} <span class="... font-mono">{$tag}</span> {/define} Thanks
    1 point
  15. That helps. Ok I tried the following: // _main.latte {include 'test.latte'} // test.latte {bd($wire)} // result // $wire is a ProcessWire object Next using {embed} // _main.latte {embed 'test.latte'}{/embed} // test.latte {bd($wire)} // result // $wire is NULL This is exactly the behaviour that the docs state: That's what I wished you provided, so I can easily try things out and can follow. But seems we are there now. Yes. Always remember LATTE = PHP, so you can do this, for example: {extract(\ProcessWire\wire('all')->getArray())} {bd($wire)} {bd($modules)} As you can see when adding the namespace to any function api it will also work! Again, it's just PHP. Or you could also do this: // _main.latte {embed 'test.latte', api: get_defined_vars()}{/embed} I'm sorry, but I'm not going to try to guess what you mean. Actually I tried, but unless you provide a simple step by step example like I did above I can't help, as I don't know/understand what the problem is. Maybe you already mentioned it, but I can't remember everything you wrote and showed in one of the extensive examples. I know you are busy, but so am I, so it would be nice to make it easier for me to follow and help 😉
    1 point
  16. $items = $pages->find("template=event_day, event_schedule.speakers={$page->id}"); foreach($items as $item) { foreach($item->event_schedule as $repeater_item) { echo $repeater_item->event_title . '<br>'; } } It will echo out all the repeaters for that page, even though the speaker is only in one of them? What's the point of the first portion ($items) if you have to make another exception to see if the speaker is in the second foreach loop?Apologies for perhaps not seeing the forest from the trees!
    1 point
  17. By default, the "Forgot Password" module is not turned on in v2.1. My thought was that lack of such a function is technically more secure (on any site or CMS). Why? Because having such a function active means your password is only as secure as your email (*though see note at end of this message). So I thought we'd start things out as secure as possible and let people adjust it according to their own need. But I'm rethinking that decision, and may change it to be 'on' by default. If you don't already have that "Forgot Password" module installed, it is relatively easy to reset your password with the API. Lets say that you lost the password for your account named 'admin' and you wanted to reset it. Paste this code into any one of your templates (like /site/templates/home.php in the default profile, for example): <?php $admin = $users->get('admin'); $admin->setOutputFormatting(false); $admin->pass = 'yo12345'; // put in your new password $admin->save(); …or if it's easier for you to copy/paste everything on one line, here's the same thing as above on one line: <?php $users->get("admin")->setOutputFormatting(false)->set('pass', 'yo12345')->save(); Replace "yo12345" with the new password you want and save the template. Then view a page using that template (like the homepage, in our example). The password for that account has now been reset, and now you are ready to login. Don't forgot to now remove that snippet of code from the template! Otherwise your password will get reset every time the page is viewed. Once logged in, here's how to install the Forgot Password capability: 1. Click to the "Modules" tab. 2. Scroll down to the "Process" modules. 3. Click "Install" for the "Forgot Password" module. That's all there is to it. You will now see a "Forgot Password" link on your login page. *ProcessWire's "Forgot Password" function is actually a little more secure than what you see in most other CMSs. Not only do you have to have the confidential link in the email, but the link expires in a matter of minutes, and PW will only accept password changes from the browser session that initiated the request. So an attacker would have to initiate the password change request and have access to your email at the same time, making it a lot harder for a man-in-the-middle snooping on your email.
    1 point
×
×
  • Create New...