Leaderboard
Popular Content
Showing content with the highest reputation on 12/05/2022 in all areas
-
I've had a conversion with @3fingers over the last few days regarding that topic. I contacted him via PM because I am planning something similar and I did not want to give the impression that I was torpedoing his plan (or that he spends much time that in the end does not pay off because there is a similar free course by someone else). To be more specific, what I have had in my mind for quite some time now is to make a ProcessWire version of this video: ProcessWire from Scratch 2022 | Laravel Alternative? (on processwire.rocks) I thought that might be a good idea for several reasons: While watching that video to get an impression of laravel I thought so many times: "That would be so much easier in PW", so I wanted to show that to others I thought such a video could maybe catch brad's attention and he might be willing to share the video across his audience or even try PW and make a video about it himself I thought it's a good starter project with a good structure that shows a lot of the most important concepts and it would be nice to have a side-by-side comparison @3fingers asked me to post this publicly to get some feedback from the community so that we can then decide how we should proceed so that everybody benefits from it.6 points
-
I usually do post rock: Sigur Ros Under Byen Album Leaf Godspeed You! Black Emperor, etc. Sometimes some shoegaze My Bloody Valentine (duh) Fleeting Joys Blonde Redhead, etc. Often game soundtrack bits: Amos Roddy (Two Kingdoms franchise) - this gets LOTS of play - just super calm and thoughtful ambient. Disasterpeace (Fez, Hyper Light Drifter) Bioshock scores and the Black Mesa score Love the Limbo soundtrack - its just too short. He's got some tracks in a few other games but they just aren't as interesting IMO. Lots of Fripp and GC stuff, some Eno also. Sometimes the prog side but usually that's too engaging to code. Dunno, all over the place in general. Lately I've been on an old Tame Impala and old Phantogram kick. My playlist is all over the place. Sometimes classical - Holst, Bartok, etc. I think the only rule is I have to be familiar with it. I can't just throw a new Tool album on or something and think I'm going to be able to concentrate.5 points
-
This week we've got a new core version on the dev branch, version 3.0.208. This version includes 15 new commits with a combination of issue resolutions and new features. See the dev branch commit log for full details. In addition, we have new versions of the following ProFields modules: FieldtypeTable, FieldtypeTextareas, FieldtypeMultiplier and FieldtypeFunctional. (Last week a new version of FieldtypeCombo was released as well). These are all posted in the ProFields downloads thread. These versions all add support for the new InputfieldTinyMCE module, in addition to other regular improvements and updates. I think that completes the list of modules I've developed that needed an update to support InputfieldTinyMCE. Speaking of InputfieldTinyMCE, it also received updates this week, primarily focused on resolving reported issues. Thanks for reading and have a great weekend!4 points
-
I finally found , the new master release 0.0.10 works here with the latest FormBuilder release. Let me know if you encounter any issues.3 points
-
CMS is the wrong word for it - you mean "WYSIWYG Editor" or "Pagebuilder" (CMS = Content MANAGEMENT System) I think if you don't want to write HTML (or PHP), then Processwire is not the best choice for you.3 points
-
With all the hype about ChatGPT, I wanted to see how useful it could be for us ProcessWire lovers. In a word: wow! It's pretty darn impressive for such early public testing and for such targeted subject. I love how it proposes code with comments, then proceeds to explain it. (Note: I've been getting more impressive and consistent results on mobile for some reason.) Prompt: Filter blog post by category in ProcessWire To filter blog posts by category in ProcessWire, you can use the find method of the $pages object, along with the category field and the equals operator, like this: // Get the category slug from the URL $category_slug = $input->urlSegment1; // Find all blog posts in the given category $posts = $pages->find("template=blog-post, category.slug=$category_slug"); // Loop through the posts and output their titles foreach ($posts as $post) { echo "<h2>$post->title</h2>"; } This code will find all blog posts that are in the category with the given slug, and output their titles. You can modify this code to output other information about the posts, such as their content, images, or dates. To make it easier for users to filter posts by category, you can also create a navigation menu that lists all the available categories, like this: // Find all categories $categories = $pages->find("template=blog-category"); // Output a link for each category echo "<ul>"; foreach ($categories as $category) { echo "<li><a href='/blog/$category->slug'>$category->title</a></li>"; } echo "</ul>"; This code will find all blog categories and output a link for each one, using the category slug as the URL parameter. When a user clicks on a link, they will be taken to the blog page with the posts filtered by that category. Prompt: Login form in ProcessWire To create a login form in ProcessWire, you can use the following code: // Check if form has been submitted if ($input->post->submit) { // Sanitize user input $email = $sanitizer->email($input->post->email); $password = $sanitizer->text($input->post->password); // Check if user exists and password is correct $user = $users->get("email=$email"); if ($user && $user->matches($password)) { // Login user $session->login($user); // Redirect to home page $session->redirect("/"); } else { // Output error message $error = "Invalid email or password."; } } // Output login form echo "<form method='post'>"; echo "<label>Email:</label>"; echo "<input type='email' name='email' value='$email'>"; echo "<label>Password:</label>"; echo "<input type='password' name='password' value='$password'>"; echo "<input type='submit' name='submit' value='Login'>"; echo "</form>"; // Output any errors if ($error) { echo "<p class='error'>$error</p>"; } This code creates a login form that accepts an email and password. When the form is submitted, it checks if a user with the given email exists, and if the password is correct. If the email and password are valid, it logs in the user and redirects to the home page. If the email and password are invalid, it outputs an error message. Prompt: User registration class in ProcessWire with email, password of at least 10 characters and age over 18. Check if email is unique. To create a user registration class in ProcessWire with email, password of at least 10 characters, and age over 18, you can use the following code: class UserRegistration { public function register($email, $password, $age) { // Sanitize user input $email = $sanitizer->email($email); $password = $sanitizer->text($password); $age = (int) $age; // Validate user input if ($age < 18) { $errors[] = "You must be over 18 to register."; } if (strlen($password) < 10) { $errors[] = "Your password must be at least 10 characters long."; } if ($users->get("email=$email")) { $errors[] = "A user with this email already exists."; } // If no errors, create user account if (!$errors) { // Create new user $user = new User(); $user->email = $email; $user->password = $password; $user->age = $age; // Save user to database $user->save(); // Redirect to confirmation page $session->redirect("/confirmation"); } } } This code creates a UserRegistration class with a register method that takes an email, password, and age as arguments. The method sanitizes and validates the input, and creates a new user if the input is valid. It also checks if a user with the given email already exists in the database, and outputs an error if one does. To use this class, you would first instantiate it: $registration = new UserRegistration(); Then, you can call the register method to create a new user: $registration->register($email, $password, $age); Prompt (similar to previous one): User registration form in ProcessWire with first name, last name, email, password of at least 10 characters and age over 18. To create a user registration form in ProcessWire with first name, last name, email, password of at least 10 characters, and age over 18, you can use the following code: // Check if form has been submitted if ($input->post->submit) { // Sanitize user input $first_name = $sanitizer->text($input->post->first_name); $last_name = $sanitizer->text($input->post->last_name); $email = $sanitizer->email($input->post->email); $password = $sanitizer->text($input->post->password); $age = (int) $input->post->age; // Validate user input if ($age < 18) { $errors[] = "You must be over 18 to register."; } if (strlen($password) < 10) { $errors[] = "Your password must be at least 10 characters long."; } // If no errors, create user account if (!$errors) { // Create new user $user = new User(); $user->first_name = $first_name; $user->last_name = $last_name; $user->email = $email; $user->password = $password; $user->age = $age; // Save user to database $user->save(); // Redirect to confirmation page $session->redirect("/confirmation"); } } // Output registration form echo "<form method='post'>"; echo "<label>First Name:</label>"; echo "<input type='text' name='first_name' value='$first_name'>"; echo "<label>Last Name:</label>"; echo "<input type='text' name='last_name' value='$last_name'>"; echo "<label>Email:</label>"; echo "<input type='email' name='email' value='$email'>"; echo "<label>Password:</label>"; echo "<input type='password' name='password' value='$password'>"; echo "<label>Age:</label>"; echo "<input type='number' name='age' value='$age'>"; echo "<input type='submit' name='submit' value='Submit'>"; echo "</form>"; // Output any errors if ($errors) { foreach ($errors as $error) { echo "<p class='error'>$error</p>"; } } Watch out, this is addictive ?2 points
-
? [[ UPDATE December 6, 2022 ]] ? I prepared a small landing page to validate how many of you would be willing to take the course, so that we would have a rough estimate of how many people would be willing to take the course. ? Show me your interest here ? ------------------------------------------------------- Hello to the entire wonderful Processwire community! I am here to announce my willingness to create a video course for beginner/mid-level developers interested in learning more about the main aspects of our beloved CMS. I have been working with Processwire continuously for years now, so I feel confident that I can share what I have learned to other developers interested in becoming faster and more efficient in their day-to-day work. I have noticed that lately many people here in the forum have complained about a lack of material and tutorials for taking the first steps, and although so many resources are already present within the board, I understand how complicated it can be to be able to connect the dots and have a clear reference on how to get started or how to find clear answers in a short time. As you know Processwire is a very broad tool, very flexible and able to be adapted to any need, so it will not be possible to dissect every aspect in this course, especially the more advanced ones that can help in rarer cases (at least in my personal experience). ? But don't worry, I plan to explain with many practical examples many tips and tricks that can help you in developing sites, even particularly structured ones! ? So I am here to test your interest and ask you what aspects you would be most interested in me covering, even those related to design (css, scss, postcss, tailwind) or javascript libraries/frameworks integrations (vue, alpine.js, greensock for animations,etc.). My idea would be to create together a magazine with a restricted area for users, newsletter integration, catalog filtering according to different parameters (year, author, topics, etc.) and much more.? It will be a paid course, I have not yet decided what the price will be, but it will be affordable for everyone ?. For a small period of time, I would be pleased if you would give me pointers and ideas, so I can see what your real interest is (if any!) and also motivate me ? Let me know! Thanks! ?2 points
-
Hello and welcome to the forum! your question is related to a 3rd party module https://processwire.com/modules/markup-processwire-photoswipe/ On the module page you can see a link "Support" which links to the dedicated forum thread for that module. You might want to ask your question there. Besides that, the module has last been updated 6 years ago. So it uses an old version of the https://photoswipe.com/ script and might not be compatible with the latest ProcessWire version. In general, 3rd party modules are maintained by their authors and it is up to them whether they update them and offer support. It is up to youwhether you want to use and rely on a module with outdated code. After having a quick look at the module code, there is no easy way of bringing in the page title into the markup through the available render options. Like stated in the module documentation, you would have to extend the MarkupPwpswpGallery class. Alternatively you could edit the module code directly to achieve what you want. For a start have a look at https://github.com/blynx/MarkupProcesswirePhotoswipe/blob/a7c495964262f30eb28e891437665913ea5c5164/MarkupPwpswpGallery.module#L162 following and https://github.com/blynx/MarkupProcesswirePhotoswipe/blob/a7c495964262f30eb28e891437665913ea5c5164/MarkupPwpswpGallery.module#L196 following.2 points
-
Been over a year since last update, so another quick heads-up: MarkupMenu 0.11.0 adds support for menu items as an array (as an alternative for the module figuring the menu structure out from current and root page, or reading it from a PageArray) and template strings as callables. Needed these two for a project I'm working on ? echo $modules->get('MarkupMenu')->render([ 'current_page' => $page, 'menu_items' => [ [ 'title' => 'Home', 'url' => '/', 'id' => 1, ], [ 'title' => 'About', 'url' => '/about/', 'id' => 29, ], [ 'title' => 'Parent', 'children' => [ // ... ], ], ], 'templates' => [ 'item' => function($item) { return empty($item->url) ? '<span>{item.title}</span>' : '<a href="{item.url}" class="{classes} {class}--level-{level}">{item.title}</a>'; }, ], ]);2 points
-
1 point
-
I agree. However, to make a tutorial series complete, one needs to introduce the basics as well. Perhaps a concise but not too long overview would do the trick (especially if it links to all the official docs and blog posts in order to point out where to learn more about the basics). @3fingers In order to teach as much as possible in the shortest possible time, you might want to provide your learners an installable site-profile which does all the basics already, and you "just" finish it off by implementing the rest (which is everything beyond the basics). I would also pay for such a course, so that I can think outside of my box (and to support your efforts, of course).1 point
-
The sanitizer method intended for text that will be used as a selector value is $sanitizer->selectorValue(). See for example in Ryan's demo skyscrapers site. By default this sanitizer will filter out the asterisk, presumably because it's a character used within some selector operators. But it looks like if you whitelist it in the $options argument and it will be retained and the error is avoided because the value gets wrapped in quotes. $q = $sanitizer->selectorValue($input->get('q'), ['whitelist' => ['*']]);1 point
-
This could possibly become a course all on its own, but there are often questions on how to manage navigational structures (header/footer/on-page) in ProcessWire. Covering how to (try to) plan around it, either based on the layout design, or based on the architectural design (or the client need?) are all potential topics. Sites with simple structures (and few templates) are usually fairly easy, but if you were to design a website for a university that holds many different departments all with unique needs and content, things can get quite complicated; often times there is the primary navigation, a sub-navigation (that may break into child-navigations per department), and custom footer navigation areas per section! If aimed at beginners, something that should likely be covered early on is templates/themes and ProcessWire's Site Profiles, and how unlike other solutions, downloadable site profiles contain not only the layout and design, but also the underlying architecture and fieldtypes, so switching templates is not (currently) a thing with ProcessWire. (We'd need something like WordPress' various theme builders [ex: Divi] where it's a theme framework, so the framework is the profile, and themes/templates/styles could be swapped within the framework...we just don't have that [yet?] for ProcessWire.) ...oh, and also that files and images are associated to the pages they were uploaded to (instead of a centralized media manager, unless one is setup [through a page] in your magazine website example). Also of note, and this took me awhile too: It's "ProcessWire", not "Processwire". ? I'd probably sign up just because I enjoy taking courses. You can always learn something new. Video courses are a lot of work (to keep updated) so I wish you the best of luck on this!1 point
-
Frontend forms in general would be a good topic. There's so much to find scattered around the forum but still people seem to struggle with it, especially when it comes to frontend file uploads with WireUpload.1 point
-
Sounds great. There are some PW video tutorials out there. But nothing structured or consistent like you are planning to do. Do you mean that others can contribute videos as well? You could use a platform like https://www.codecademy.com/ to publish your courses. Will propably reach a broader audience than a custom made solution. concept of "everything is a page" structuring content working with templates/fields in the admin different output strategies: delayed, MarkupRegions etc PW as headless CMS with https://processwire.com/modules/app-api/ or https://processwire.com/modules/process-graph-ql/ I wouldn't concentrate too much on that because there are tons of tutorials out there already and PW is flexible enough to let devs implement frontend stuff in so many ways. But the basics of where you can place your source files, and how to include assets in template files might be helpful. Go for it and good luck!1 point
-
Just a quick update this week, as yesterday was a holiday here and it becomes kind of a holiday week with kids out of school. On the core dev branch, the built-in PageFrontEdit module has been updated to support the new InputfieldTinyMCE rich text editor module. In addition. The $sanitizer->email() method has been updated with several new options. These include support for emails with Internationalized Domain Names (IDNs), UTF-8 local parts and an option to validate the DNS of the email domain. Currently all of these options are off by default but can be enabled with a new $options argument. These options will likely be translated to configure options for email fields (FieldtypeEmail) in the next week or so. In addition, a new version of the ProFields Combo has been released and this version also adds support for the new InputfieldTinyMCE module. I'm also working on updates for ProFields Table and Textareas for support of InputfieldTinyMCE as well, but those updates aren't quite ready to post just yet. If you opt to use TinyMCE with PageFrontEdit or Combo, make sure you grab the latest version of InputfieldTinyMCE, as it also received related updates this week. Thanks for reading and have a great weekend!1 point
-
Hello and welcome to the forum! In PW you can override core modules by copying them from wire/modules to site/modules. If you have multiple copies of a module installed, you can go to Modules->Configure->AdminThemeUikit and choose there which copy to use. If you don't have this choice in the Module Edit Screen, follow these instructions: Copy wire/modules/AdminTheme/AdminThemeUikit to site/modules/AdminThemeUikit and then in the backend main menu do a Modules->Refresh, you will get a notification that AdminThemeUikit has multiple files installed in different locations and it lets you choose which file location to load the module from. You can do this and choose the files in wire/modules/AdminTheme/AdminThemeUikit. After that you can delete the site/modules/AdminThemeUikit folder and the warning should be gone.1 point
-
https://50thbirthday.londonfriend.org.uk/ This is a site we created to celebrate the 50th anniversary of London Friend which is the UK's oldest LGBTQ+ charity. It has a timeline that covers significant events of the charity's history together with a showcase of 50 inspirational Londoners who have made a difference to life in the capital. The technical side of things is pretty much as you imagine. One choice we made was not to use ajax for loading the timeline events but instead loading all of the html and then leaning hard into caching and lazy loading of images. We did use @markus_blue_tomato 's imageBlurHash module to produce placeholders for our lazily loaded images - although honestly you rarely get to see them. For some of the pages the client wanted to be able to add footnotes so we created a text formatter than moves any text in a content block surrounded in square brackets into footnotes section and creates an anchor link. I'll tidy that up and pop it on GitHub when I get some time but feel free to nag me if you think it might be useful to you. Other modules of note were ProCache and (of course) TracyDebugger. We also have some galleries on the site that use PhotoSwipe which is still our g to script for phot galleries. We got great marks in Lighthouse, Observatory and Wave (even the timeline itself which is a complicated page still does very well). It was great to be part of the celebrations (just a shame that I'm on holiday when the launch party happens... dammit)1 point
-
I will take a look into it this week. In the meanwhile you try to create the blurhash based on a smaller size. I make this on also every blurhash pic on blue tomato E.g. // original pic size: 500/200 $hash = $page->pic()->getBlurhashDataUri(50, 20);1 point
-
@Markus (Blue Tomato) I had a chance to use this on a production site and it's working great! Looks fantastic. Quite a bit faster than expected as well — I measured 10ms per image on a low-end Digital Ocean box, so no need for atomic caching so far. Thanks again for releasing, really appreciate this one ?1 point
-
This is a great concept, thanks for creating a module for it - have to try that soon! ?1 point
-
All tests done on my side - I pushed a new Release to Github. Thanks to @androbey for finding the fix1 point
-
Only if it's executed before or after template rendering, which is most of the time, but not always. That's why I go with this in places, where I cannot be sure about the state of output formatting: $page->getUnformatted('image')->first()->url1 point