Leaderboard
Popular Content
Showing content with the highest reputation on 04/06/2023 in all areas
-
I have been using HTMX recently and it really is a very good option. Of course all of its functionality can be achieved using the Processwire API, and including partial files in the template file. But it would be wonderful to have some kind of facilities in our framework. Maybe with a new method in the PageRender class, that allows to select specific elements of the template file markup. The following is a simple idea based on the Markup Regions syntax: <pw-region id="content"> <h1><?= $page->title ?> <?= $page->summary ?> <h2>Contact Details</h2> <div id="contact_info" pw-fragment> <p><strong>$page->contact_name</strong></p> <p>$page->contact_address</p> </div> <h2>Social Channels</h2> <div id="total_likes" hx-swap-oob="true" pw-fragment> <a href="https://www.facebook.com/">$page->likes</a> </div> <p>Please, Call Us!</p> </pw-region> Since I'm not a programmer and I don't really understand very well how PW works inside, perhaps one of the following options can work to execute the rendering of the fragments (It can use the Find method that Markup Regions has for HTML tags) $output = $page->render("#contact_info#total_likes"); $output = $page->render("basic-page.php#contact_info,total_likes"); $output = $page->render("fragment=contact_info|total_likes"); $output = $page->fragment("contact_info|total_likes")->render(); $output = $page->render()->fragment("contact_info|total_likes"); $output = $page->renderFragment(["contact_info","total_likes"]); wireFragment() Of course this method does not use the append file of the "_main.php", perhaps doing a: $this->halt(); Laravel Blade has this already implemented for precisely the same purpose. Check this video: https://youtu.be/3dPUsXsDZsA https://htmx.org/essays/template-fragments/ @ryan what do you think about this? Everyone, would this be a good idea? ..or something similar?3 points
-
This is an excellent idea and would simplify some of the gymnastics required when working with HTMX or similar libraries. I think this would fit nicely into how ProcessWire works.3 points
-
Like @wbmnfktr we only really do bespoke designs. If a client asks us to do a 'bog standard' website then honestly we're going to point them either at a site builder ( Wix / Weebly / Squarespace ) or even (shudder) WordPress. That's because there are so many off the shelf templates for those platforms that will probably do just what they much cheaper than we can. A hosted solution also means we don't have to be involved in keeping systems up to date and applying the inevitable WP security patches. There's also the fact that building those kind of sites honestly isn't that satisfying. Website builders are just getting better and more convenient for user so I think your business will really need to offer something above what they offer in order to be a success, and this is exactly where ProcessWire can help. Nearly all of the sites we build have some bespoke functionality, whether it's for a campaign or gathering and presenting data in an interesting way. Using ProcessWire means we can rapidly develop that extra functionality they need to add value to their site. If you're not a designer then it would definitely be worth partnering with a someone who has design experience. For purely functional sites you can use Bootstrap / UIKit etc but creating a bespoke site is definitely something a professional designer needs to be involved with. A good design is valuble to your client so something they should be paying for; probably the hard part is going to be convincing them of the value you're providing over and above just using an off the shelf design.3 points
-
Hi @Pete, I have started working on this. I have created a repo to demo usage of my 3 amigos - htmx + Alpine.js + Tailwind CSS - in ProcessWire. Stuff there will not necessarily be related to Padloper. I thought a repo like this gives everyone an opportunity to see what is achievable, and perhaps submit PRs as well. It is still early days so I haven't committed much. The first demo will be your htmx + Alpine products modal. Will let you know when that drops.2 points
-
RestApi Jumplinks These are the only modules that take care of or interfere with your URLs - at least I know this for sure with these two. What I would do now is this: Check the Access settings in the template Check the 404 monitor in Jumplinks to see if the 404 exception actually exists/gets caught. Check for existing jumplinks in Jumplinks for that URL. Check that specific page you are testing with for entries in the settings tab under What other URLs redirect to this page? Check if PagePageHistory module is installed, which is needed for the previous point Check redirects in .htaccess. Check if the RestApi module is involved here and double check that setup. Check the settings in the Languages Support - Page Names module Check if there is something in _init.php, init.php, ready.php and maybe even config.php. Or search any of your templates for: $session->redirect and redirect Redirects don't happen that random that's why I am bit confused for this one.2 points
-
Mostly because of that. For example I wanted to use https://bootstrap-table.com/ and some other smaller interface elements, as well. Also, its docs are better than the UIKit's, I think. While Bootstrap 4 was not something I considered moving to, Bootstrap 5 has matured a lot, so that is why I started to looking into using it in the first place. Also, Bootstrap is more of a "low level LEGO" solution compared to UIKit, which can be a good thing at times. (For this reason, it is easier for beginners to start with UIKit 3, I believe.) I am also a fan of Unpoly and jQuery so I do not need yet another similar helper. uikit.min.js is 139Kb while the full version of jQuery is 90Kb so it looks like the UIKit developers had to (at least partially) reinvent the wheel just to get rid of jQuery. (I have never used UIkit.util too much, so I cannot say for sure, but looking at the docs they have overlapping features.) Also, Unpoly and jQuery has overlapping features, too, but I am still not ashamed of using jQuery even in 2023 :) I'm mostly using it for its powerful "selecting" capabilities, which are concise and have matured throughout the years.2 points
-
Hello All, just want to feedback in this thread about my personal start with PW and my progress: I watched the video series of Jonathan Lahijani about WP vs. PW and got very excited. Found a german yt playlist of @LeonidLezner with some infos to start with. After these two series, understood the main concept and advantages BUT, also understood that there is a lot to learn about PHP and CSS coding to get into PW. It's not just working in the nice PW backend... ? This topic is a bit kind of "under-represented" in the Getting started intros. This is definitly not like WP... - it's way better, but also way more coding itself! So, where is a good starting point to get in this PHP and CSS topics in connection with PW dev? I also did the Beginners Guide of Francesco Schwarz, but there is not too much about it in this one... Great thanks for help Daniel1 point
-
Here's an earlier lecture on YouTube by Tristan and Aza. And, in other news: Italy temporarily blocks ChatGPT over data privacy concerns https://www.cshub.com/executive-decisions/news/italy-bans-chatgpt-over-data-privacy-concerns1 point
-
As this was the first google search result for PW get CSV I just wanted to mention that we now have $files->getCSV() https://processwire.com/api/ref/wire-file-tools/get-c-s-v/1 point
-
While learning ProcessWire you will burn through a lot of test and demo sites. Or at least I did. And it was fun. Just start building something you already know the structure of. Like a blog, music collection or movie review type of site. Those data structures are relatively easy so it's a good starting point in my opinion. You will get things wrong at the beginning or will find better solutions later on. Enjoy the process. I rarely use HTML-comments in my PHP files so there is nothing I had to change. There are two awesome plugins preservim/nerdcommenter and tpope/vim-commentary - maybe those have some settings available to master this part. Yet I support @flydev's recommendation of using VS Code could be a better option right now. You have way easier access to everything and always see where you are, where you might need to go, and yes... the whole structure. Way more important are extensions. That's way easier in VS Code than in VIM. Maybe not better but faster. The moment you know all necessary files, where they are, which names they have, which names and files might be in several places or are similar (init.php and _init.php for example) switch back to VIM if you like. FZF or Telescope are way faster and more reliable than VS Code's Ctrl+P feature. With NVIM's LSP setup and some configs it could probably outsmart VS Code extensions as well.1 point
-
I guess you are not missing anything but RockMigrations is missing the "setRolePermissions" method. I've done some aggressive cleanup when transitioning from RM1 to RM2 to make sure that RM2 does only have methods we really need to have. Could you please copy https://github.com/baumrock/RockMigrations1/blob/1ee9f9eb4afaf83529bcedf443b31dd63a5403c8/RockMigrations1.module.php#L2135-L2145 over to RockMigrations.module.php and let me know if that solves the issue?1 point
-
@MoritzLost I added it this way. Thanks a lot for the help and the module! Another question that I have: If I wanted to add it manually, where in your snippet do you choose the specific form? Or would it add the hCaptcha to all forms? // site/init.php wire()->addHookAfter('ProcessPageEdit::buildForm', function (HookEvent $event) { $form = $event->return; $submitButton = $form->getChildByName('submit_save'); if ($submitButton) { $hCaptcha = $event->wire('modules')->get('InputfieldHCaptcha'); $hCaptcha->set('label', __('Spam Protection')); // ... configuration goes here $form->insertBefore($hCaptcha, $submitButton); } $event->return = $form; });1 point
-
PHP as there is no HTML file to lookup anymore, use ncm2 and php-actor plugins. But, as a small advice (I am a nano guy, you know it, real programmers use nano lol), do yourself a second favor, try VSCode, optionally install the VIM theme ?1 point
-
Welcome, I see you already got gud answers, and I like to put as always what made me understand ProcessWire on first start. https://youtube.com/watch?v=IHqnLQy9R1A There is one or two more vid to see. Then there on the forum is a lot of good threads. I am on mobile so I give you the oldest but still ✅ to follow, quite a gold post for beginners : https://processwire.com/talk/topic/4173-grouped-forum-posts-links-articles-tutorials-code-snippets/ Forgot to add something you should also consider giving a look - page-grid - https://weekly.pw/issue/454/ Enjoy ?1 point
-
I think that is the simplest and cleanest approach. It's possible to spin up multiple databases for one project (https://stackoverflow.com/questions/49785023/how-can-i-create-and-load-a-second-database-in-ddev) but as long as you don't need to have both projects talk to each other I think having them isolated would be the way to go. Just curious: Did you also find processwire.rocks or did that not pop up in your search? Especially the video about RockFrontend could be very interesting for you. I second that recommendation. Having a css framework has helped me a lot to get things done (and work ? ). I'm a huge fan of UIkit and especially in combination with RockFrontend it's a joy to use. I'd be curious in why you switch to bootstrap @szabesz? I've been looking into Bootstrap recently as there is a lot bigger ecosystem around bootstrap. There are so many great and free templates for bootstrap, but none for uikit. Also their efforts on using css variables is very interesting! I'm just a little afraid of the switch. RockFrontend + Less + UIkit work so well and I usually have all the tools that I need and even the awesome UIkit Javascript Microframework is so nice (https://github.com/uikit/uikit-site/blob/feature/js-utils/docs/pages/javascript-utilities.md) that I'm afraid I'd be missing something on bootstrap ?1 point
-
I'm also using DDEV for 1,5 years now coming from Windows+Laragon and I could not be happier. Can't remember of any issues and changing PHP versions is as easy as changing the config file and doing a "ddev restart". Also it makes things possible that were not possible with Laragon, for example on one project I needed poppler-utils for generating JPG images from PDF. On the linux server this worked nicely but on Laragon not. So local development was different from the live server environment and that's not ideal. Also when working on projects in a team DDEV is great. Just share the github repo of the project including the config.yaml of DDEV and your teammate just have to do "git pull && ddev import-db -f /site... && ddev start"1 point
-
We're looking for someone to take over a ProcessWire site. I will leave the agency I'm currently working for, and since I was the only PW-developer there, we can't guarantee a professional maintenance anymore. Some information: Site is multilingual, 4 languages Pro modules: FormBuilder, Lister and ProFields Current version is 3.0.210 and was launched 5 years ago. The site makes heavy use of FormBuilder. The data is saved to Google Sheet. That works smooth as silk, but sometimes the client needs a helping hand with config (basically, there is a master form which they always clone, and then change some basic stuff). This Google Sheet has to be moved to another account. There is nothing overly complex about this site. There are a few protected pages. I have written a big manual for the client, i.e. tips about the WYSIWYG editor, recommended image sizes, FormBuilder gotchas, how and where to edit categories (related pages) etc. To be honest, I don't expect a big number of new feature requests in the near-term future. We just want to make sure they know who to call, if there's any questions. However, they mentioned that they want a rehaul of the homepage (they switched hosting recently and bought a new domain). If you're interested, write me a PM.1 point
-
So... there are more videos in german available. I recently found these from @hheyne. https://www.youtube.com/@henningheyne/videos They will help a lot to get into the topic of ProcessWire even more. The easiest way to get a basic understanding of PHP - at least in my opinion and for a good start with ProcessWire - the official tutorials are really good at this. They tell you how to work with ProcessWire and the absolute basics you need. You can achieve a lot with just that. Maybe not an eCommerce/shop system or similar, but a blog, portfolio, and such are absolutely possible. Maybe look into the existing site profiles to see how others do things. There are some interesting ones there. https://processwire.com/docs/tutorials/ https://processwire.com/modules/category/site-profile/ You really should play with these and give them a try. In terms of all the frontend stuff... that's a bit harder. Even though Bootstrap and UIKIT are nice frameworks, you should know at least the basics of HTML and CSS. Which brings us back to the beginning unfortunately. The way I learned most of the stuff was by playing with existing themes and templates - that's decades ago. There are tons of free themes/templates out there you could deconstruct. https://styleshout.com/ https://html5up.net There are good tutorials from Kevin Powell, WebDevSimplified, developedbyed, and many more on YouTube. Maybe give them a try.1 point
-
This error also happens with PHP 8. Modify line 707 $_timestamp = ''; to $_timestamp = null; Solve the error. Gideon1 point
-
Hi J1312, but this must work too! I haven't a 2.3 stable version installed here, only latest dev, so I cannot test. But it sounds not logical. What are the dimensions of the original image and what is the setting for upscaling? Maybe a typo in $options, please use: size( 80, 90, array('cropping'=>false, 'upscaling'=>true) ); OH, blink-blink: you also should use removeVariations() first, while testing. please use: $image = $page->images->first(); if($image) { $image->removeVariations(); // otherwise it may take a previous cached version instead of create a new one echo "<img src='{$image->size( 80, 90, array('cropping'=>false, 'upscaling'=>true) )->url}' />"; }1 point