Michael van Laar

Members
  • Content count

    95
  • Joined

  • Last visited

Community Reputation

74 Excellent

About Michael van Laar

  • Rank
    Distinguished Member
  • Birthday 10/19/1978

Contact Methods

  • Website URL
    https://digitalardor.com/

Profile Information

  • Gender
    Male
  • Location
    Fürth, Germany
  • Interests
    Data-driven digital marketer – passionate about inbound marketing, web design, food, music and sci-fi. Allons-y!

Recent Profile Visitors

7,157 profile views
  1. I just used a Repeater field on a hidden “website config” page to create my own menu building tool with exactly the features I needed for that website, including using multi-language fields within the repeater.
  2. @Standard Forge, if you just want to make one or two minor changes to a rendered menu without having to build all the markup yourself (using getMenuItems()), you can do a quick str_replace. Example: $menu = $modules->get('MarkupMenuBuilder'); // cache the rendered menu $schema_menu = $menu->render('my-menu-name'); // alter the rendered menu to your desire $schema_menu = str_replace('<li ', '<li itemprop="name" ', $schema_menu); $schema_menu = str_replace('<a ', '<a itemprop="url" ', $schema_menu); // output the altered menu echo $schema_menu; Quick and dirty, I know. But if you are using delayed output anyway, it’s just one or two lines of code.
  3. I took a few minutes to investigate. As far as I understand, the variable $redirectURL in /wire/modulesProcessProcessPageView.module is used to perform the above mentioned redirect (as well as any redirect which is necessary when handling URLs). In this case the varibale $redirectURL is set in /wire/modules/LanguageSupport/LanguageSupportPageNames.module, between line 202 and line 317. If it’s possible at all to eliminate the default language’s name segment from the URLs of pages of a specific tree branch – which is something @ryan or someone knowing the core really well could tell –, writing a hook that alters $redirectURL before it is used would be the direction I’d think of. But since I still haven’t had much time to learn more about the different hooks, this is only a guess.
  4. I have the same challenge now on a multilang site. Using PW 3.0.42 with the default multi-language setup. A certain branch of the page tree should act as a kind of microsite, with different templates etc. But only in the default language (English). As far as I understand I’d “only” have to disable the automatic redirect from domain.com/microsite to domain.com/en/microsite – which is obviously a default feature of the multi-language setup – for the specific branch. I guess this feature is hidden somewhere in the LanguageSupport core module. So it should be hookable (since pretty much everything in PW is hookable). Anyone has a deeper understanding of the LanguageSupport core module and can provide a hint?
  5. Great idea and great module! Saves me some rather ugly additions to the displayed title page in the page tree. One thing for the Christmas wish list: It would be even greater if the module would provide a way to set up several different rule sets. So you could set up different icons to mark different things.
  6. Ah, great. Gotta test this the next days.
  7. Thanks for the explanation, @matjazp. As I said, I'm fine with being able to use resmush.it via the module, since resmush.it works like a charm, and I don’t have any images which are not sooner or later made publicly available (so there are no privacy issues). Being independent from resmush.it would be a nice extra, but it’s not really required from my side. This would be interesting for cases where PW and Autosmush are used to build a website for a closed user group with confidential content which should not be send around between servers.
  8. Of course I used the individual options. I also tried commenting out the pngquant_bin setting, hoping that the modiule would go on trying to use the next available PNG optimizer. But it didn’t work. I got the error message that pngquant could not be found.
  9. Since my Linux knowledge is quite limited, I had to research and try a bit. Only the last option (inserting the path into the module file) worked – but only for jpegoptim. If i try to upload a png, I receive an error message telling me that the pngquant command doesn’t work, even if the module now knows the path to the binary. To be honest, that’s too much work to investigate. I just use resmush.it as long as it works.
  10. Anyone has a solution for multi-language menus with custom menu items? For pages localisation works using the default_title option. But this is not possible with custom menu items. And since the items’ title field is not a multi-language field, I have no idea how to solve this. But I’m probably not the first one stumbling over this. ;-) If not, I think I have an idea how to build a solution using nested repeater fields.
  11. Is there anything I have to set up to use the local optimization tools? I'm on a shared webspace, but each customer has a separate FastCGI PHP interpreter. So it should work according to the module’s documentation. Or did I miss anything? The error messages say “Command "jpegoptim" not found.” or the similar message for pngs.
  12. Great! I was looking for a module like this after https://minimize.pw/ closed the doors. I have to test it tomorrow. I guess it works with Croppable Image 3, too, doesn’t it? Or let’s better phrase it: Does automatic mode work with all modules which extend the functionality of PW’s default image field? That would really make optimizing images a no-brainer.
  13. I know, images differ from the other media types a little bit. As an alternative to the above described I could think of input field types which work like Croppable Image 3 or ImageFocusArea, but use a Media Manager image instead of a directly uploaded image. I know this is not something which can be done with Media Manager itself. It would rather be a concept of being able not just to extend the standard image field but to extend a king of “remote image” fieldtype the same way. But I think this would have to be in the core, so that every module which extends or uses the standard (direct upload) image field could use this “get an image from Media Manager and apply the module’s magic to it” image field.
  14. Great module from what I could see in the videos. Definitely something I want to use in my upcoming projects. Only one question regarding the handling and output of images Is there a way to make any kind of pre-defined crop-settings (like in the Croppable Image 3 module) or something like the focus area from the (unsurpassedly useful but unfortunately not PW 3 compatible) ImageFocusArea module available with Media Manager? Why I ask In my websites I use responsive images wherever possible, usually using the picture element because I often need its art direction feature. So my workflow in PW 2.x was: Use the ImageFocusArea module’s input field to upload an image. Define the important region (= “focus”) of the image which must be fully visible in all cropped image variations. Have ProcessWire create all required sizes of all required image variations directly from the original image using the image sizing options (extended by the ImageFocusArea module) in the template files. The two big pros of this workflow were that the user only had to define the important area of the image once – and was not bothered with any cropping settings (like finding a good-looking image section for an extremely wide horizontal format) – and that all required variations and sizes (I usually use about 10 different images per picture element) were created directly from the original image (which ensures best quality because no unnecessary compression steps were included). In PW 3.x I had to change this due to the new image field which makes the ImageFocusArea module incompatible with PW 3: Use the Croppable Image 3 module’s input field to upload an image. Use the input field’s settings to define the biggest (in pixels) version of each required aspect ratio variation of the image. Let the user define the best looking image sections for the different crop variations (let’s say we need a 2:1 aspect ratio version and a 4:3 aspect ratio version of the image for one picture element). Have ProcessWire create the required downscaled versions of the “source images” (i. e. the variants created using the pre-defined crop settings of the Croppable Image input field) using the standard image sizing options in the template files. While it works, the two big cons here are that the user has to define the different aspect ratio variations manually (assuming that the automatically created default cropping around the image’s center isn’t the best-looking option) and that the downscaled variations of each aspect ratio variations are created from an already processed image (so this includes at least one unnecessary compression step). And of course changing aspect ratio variations later (because of a website layout revision) can result in a lot of manual work to adapt cropped image variations. What would really be a great extension for Media Manager in my opinion It would be great if the ImageFocusArea module’s functionality would be available in Media Manager under PW 3. This would make using different image variations a no-brainer – without the website editor having to know anything about image variations, aspect ratios, sizes, cropping, etc.: The website editor uploads an image in Media Manager. The website editor defines the important area of the image which may never be cut away. The website editor selects the image on the respective page using Media Manager’s input field. That’s it. The template files take care of the rest. And even if the website layout completely changes the selected image needs not to be touched, since all required image variations are created from the original, centrally available image, making sure that the image’s main motive is always presented in the best possible way. Of course, when inserted into a CKEditor field, the editor can apply an individual cropping if desired. Unfortunately I’m not a backend developer at all. So I can’t make any code suggestions on how to make this work.
  15. Wow, thanks @Robin S. That’s exactly what I was searching for. I haven’t learned much about hooks yet, simply because there was no need by now. I thought I have to write a module to achieve this. But putting this in the ready.php works like a charm and is super easy to set up.