Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/16/2023 in all areas

  1. I prefer simple plain-text signatures as well as plain-text emails. Less hassle and way less problems in case mails get forwarded or nested in a thread somewhere. Nothing fancy at all. Just the details someone might need or are required by law.
    3 points
  2. I originally developed and launched Real SF Properties in 2015 and did a complete design and programming refresh in 2022: https://realsfproperties.com/ The site was designed by BuzzCandy.Design: http://buzzcandy.design/ This was my first time using Tailwind CSS and it was a great fit for this project. I wish it existed back in 2015 because while UIkit has been my go-to CSS framework for several years now, there are some site designs (and designers) that I work with that simply need a higher level of precision to slice correctly and be maintainable. Sure, I could have used vanilla CSS and done it the classic way (separation of concerns), but Tailwind CSS and doing everything with utility classes (locality of behavior) does come with major benefits, even if the markup is not so easy on the eyes. This site does not use a matrix page builder or anything fancy. The sections are hardcoded but with the ability to add data using the various page data structures that feed in accordingly. It has also has an accessibility score that is extremely high. It's a quick loading site even though ProCache or CDN is not yet enabled. Other frontend libraries include Flickity and Headroom.js. More details on my personal website: https://jonathanlahijani.com/projects/real-sf-properties/
    3 points
  3. I was happy to read this, thanks for sharing Andy ❤️
    1 point
  4. orientation_session_item is a separate repeater field which has its own settings page, where you can define the label.
    1 point
  5. You can edit your first/original post and change the title. Add [SOLVED] at the beginning and you are done. That's our "Mark as solution" button here.
    1 point
  6. PW doesn't support that kind of sorting in $pages->find(), but you could use the FindMerge module and do something like this: $base_selector = "title=foo"; $selectors = [ "$base_selector, template=template1", "$base_selector, template=template2|template3", "$base_selector, template!=template1|template2|template3", ]; $pagination_limit = 20; $results = $pages->findMerge($selectors, $pagination_limit);
    1 point
  7. @bernhard It wasn't really a website. It's a catalog of machine parts for the company. We were then looking for a CMS that could display the hierarchical structure of the catalog well. In addition, we needed the templates to have a different structure for different types of parts. One of our young programmers at the time said: there is a great American CMS - ProcessWire, it is perfect for our task. That was in 2012. In any case, we finished this project in 2012. I found a backup now. We used ryancramerdesign-ProcessWire v 2.2 In 2013, we moved our windsurfing store project from a self-described CMS to PW 2.4. By the way, the self-written CMS has been around since 2000. At that time @Soma cheatsheet helped us much. We still maintain that project, but have updated PW each time for new features from @ryan. Back then, there was no PW module for a full-fledged store. But in 2012, @apeisa published an example of such a module Shop-for-ProcessWire. We took it as a basis and now it is a working online shop. In fact, I made my first site in 1994, and it is now also converted to PW. It was such a long story with a happy ending.
    1 point
  8. I have to stop a day early to leave town for one of my daughter's gymnastics meets, so I'm going to save the core version bump for next week, after a few more updates. The most interesting core update this week is one suggested by Netcarver and Pete. It is to make the "HTML Entity Encoder" Textformatter option (for text fields) more foolproof, by making it harder to ignore. That's because this option is rather important for the quality assurance and security of your site's output. If you forget to enable it for one text field or another, then you allow for the potential of HTML in the output for that field, by anyone that can edit pages using that field. Most of the time when you aren't entity-encoding output, HTML is exactly what you want, such as with TinyMCE or CKEditor fields. HTML entity encoding is necessary when the field value isn't itself HTML, but will eventually be used in HTML output and needs to be valid for HTML output. Think of a "title" field, for example. For these cases, you want to be sure that characters like greater than, less than, ampersand and single/double quotes are properly encoded. Greater-than and less-than characters form HTML tags like <script>alert("gotcha!")</script>, ampersands begin entity sequences, and quotes are used to open and close HTML attribute values. By entity encoding all of these characters, we ensure they can't be used for malfeasance, scripts, XSS, defacement, etc. The worst case scenario would be that you neglect to enable the entity encoding on a text field where you are allowing non-trusted user input, as that could open the door to such shenanigans. To make things more foolproof, ProcessWire now gets in your face a bit more about using the HTML Entity Encoder. Maybe it's a bit more annoying for more experienced users, but if you happen to be in a rush, it'll make sure you at least don't forget about it. Or maybe some less experienced developers might not know the importance of entity encoding in HTML, and this update helps them too. Here's what it does: It now enables the HTML Entity Encoder (Textformatter) for all newly created text fields (and derived field types). Previously it just suggested that you enable it, but let you decide whether or not it was appropriate. Now, it errs more on the side of caution. Since the entity encoder is now automatically enabled for newly created text fields (in the admin), it seemed necessary to detect cases where the field configuration clearly indicates it's intended to allow HTML (by input type or content-type). Examples include textarea fields configured to use TinyMCE or CKEditor, or any text field with a content-type set to HTML. When these cases are detected, it advises the user to remove the HTML Entity Encoder from the selected Textformatters. If editing an existing text field (in Setup > Fields) that doesn't appear intended to use HTML (i.e. not TinyMCE or CKEditor and doesn't have its Content-Type set to HTML), it will now test all the selected Textformatters you have selected (if any) and see how they handle HTML. If they leave HTML in place, or you have no Textformatters selected, It will provide a warning to you, letting you know that HTML is allowed, and leave it up you to decide whether that's what you want. Note that these additions are only for fields created in the admin. Fields created from the API make no such assumptions and work the same as before. That's it for this week. More updates and hopefully a version bump next week. Have a great weekend!
    1 point
  9. This week we've got a few minor issue fixes and a couple of pull request additions on the dev branch. Pull request #251 thanks to @Jan Romero added a download button to the thumbnail images in InputfieldImage. I wasn't sure we really needed that, but really liked his thinking behind it, which was envisioning the ability to add more custom buttons/actions for images. So while I didn't specifically add the download button, I added the proposed system for adding any custom buttons, and then applied that same thinking to some other parts of InputfieldImage. And we'll talk about how to add that Download button here. ? First, let's look at how you might add your own download button, and note we're using this as just an example, as you might add any kind of button this way. A new hookable getImageThumbnailActions() method was added for this purpose. So here's how you might hook it (in /site/ready.php) to add a download button: $wire->addHookAfter('InputfieldImage::getImageThumbnailActions', function(HookEvent $event) { $image = $event->arguments(0); // Pageimage $class = $event->arguments(3); // class to use on all returned actions $a = $event->return; // array $icon = wireIconMarkup('download'); $a['download'] = "<a class='$class' href='$image->url' download>$icon</a>"; $event->return = $a; }); With that hook in place, here's what it looks like when you hover a thumbnail image. And if you click that Download icon, it downloads the file to your computer: or in list mode (download icon appears in right corner next to trash): I was thinking it would be useful to also be able to add custom actions after you click the thumbnail, and it shows the image edit features. So let's add a Download button there instead, by hooking the new getImageEditButtons() method: $wire->addHookAfter('InputfieldImage::getImageEditButtons', function(HookEvent $event) { $image = $event->arguments(0); // Pageimage $class = $event->arguments(3); // class(es) to use on all returned actions $buttons = $event->return; // array, indexed by action name $icon = wireIconMarkup('download'); $buttons['download'] = "<button class='$class'><a download href='$image->url'>$icon Download</a></button>"; $event->return = $buttons; }); And the result looks like this (see new Download button after Variations button): We also have that Actions dropdown that you see in the screenshot above. This is already hookable but we've not had any good examples of it. In this case, you need two hooks: one to add the action to the <select> and another to handle the processing of the action when the page is saved. So in our next example, we'll demonstrate how to display verbose EXIF information about whatever image(s) the action was selected for. In this first hook, we'll add the action to the Actions <select>: // Example of adding an “Get EXIF data” action to the <select> $wire->addHookAfter('InputfieldImage::getFileActions', function(HookEvent $event) { $image = $event->arguments(0); // Pageimage if($image->ext == 'jpg' || $image->ext == 'jpeg') { $actions = $event->return; // array $actions['exif'] = 'Get EXIF data'; $event->return = $actions; } }); And in this next hook, we'll handle the action, which gets called when the page editor form is submitted: // Example of handling an “Get EXIF data” action $wire->addHookAfter('InputfieldImage::processUnknownFileAction', function(HookEvent $event) { $image = $event->arguments(0); $action = $event->arguments(1); if($action === 'exif' && file_exists($image->filename)) { $exif = exif_read_data($image->filename); $event->warning([ "EXIF data for $image->name" => $exif ], 'icon-photo nogroup'); $event->return = true; } }); And here's what it shows after you hit save (for any images that had the action selected): The screenshot above is truncated because it was about twice is big as what's above. All the above code examples are also included in the phpdoc for each of the relevant hookable methods in the InputfieldImage module. For another recent useful addition, be sure to check out ProcessWire Weekly #454 (last week) which covered some new options available for the language translation functions like __text('hello'); where you can now tell it what kind of input type (and how many rows) to use in the admin translation interface, via inline PHP comments. Thanks for reading and I hope you have a great weekend!
    1 point
  10. First of all, I would recommend reconsidering your approach. ProcessWire's built-in admin is quite user-friendly, and building essentially the same thing on your own sounds like a lot of effort that you could use for something more beneficial. Not to mention that you'll have to be pretty careful to avoid any permission related issues etc. – all in all not something I would recommend unless you've got a really good reason for it. The answers to your questions, if you still choose to go this route, would depend on your needs: do you have multiple types of users with different fields, or are they all the same? What will these users edit – their own profile page, or something else? If it's their profile page, should it be publicly viewable? If not, how are you planning to control access – on a page by page basis, or based on groups, or something else entirely? ProcessWire supports multiple parents/templates for user pages, so that might be something you could look into: https://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-templates-or-parents-for-users. Hope this helps a bit.
    1 point
×
×
  • Create New...