Jump to content

horst

PW-Moderators
  • Posts

    4,088
  • Joined

  • Last visited

  • Days Won

    88

Everything posted by horst

  1. Hi Ivan, very nice tip. I haven't known about this. May come in handy. Thank you for sharing. ? Regarding your question on overwriting single items of config arrays, you can do it this way: $config->statusFiles('ready', 'ready-dev.php'); Also, if I want to overwrite more then one item, I prefer this way: $config->statusFiles = array_merge($config->statusFiles, [ 'init' => 'init-dev.php', //'readyBefore' => '', 'ready' => 'ready-dev.php', ]);
  2. Hi @Jorge, welcome to the forums. As Kongondo already said, you can or need to use a hook to inject your desired functionality. You can use one in the site/ready.php like this: $wire->addHookAfter('Pages::saved', null, function(HookEvent $event) { $page = $event->arguments(0); // now, after you have the page related to the hook event, check if it belongs to the pages / templates you want to process if('my-desired-templatename' != $page->template->name) return; if(!$page->mycheckbox_use_github) return; // after you definetly know that you want to process this page, execute what you want to ... }); Maybe a little OT, but also maybe useful for inspiration:
  3. For me it is working as expected and described in the Blog post. https://processwire.com/blog/posts/optimizing-404s-in-processwire/ I added a static html for 404 like in your example above, and then added one line just above the last line in pws htaccess file: RewriteCond %{REQUEST_URI} !\.(jpg|jpeg|gif|png|svg|ico|html)$ [NC] as stated in the Blog post https://processwire.com/blog/posts/optimizing-404s-in-processwire/#filtering-out-missing-image-files And when I try to reach /test/noexist.html, it works.
  4. Why "upgrading" today to 2.8?? The current stable Version is 3.0.148, and 2.8 is years old and a dead end branch. It is not further maintained. Please use 3.0.148
  5. Hi @snobjorn, I do not use markup regions myself, but maybe doing a g**gle search like this: ?q=site:processwire.com/ Markup Regions will reveal something relevant you don't know?
  6. Thanks @kongondo, You also have a not inconsiderable share on it. You encouraged me to improve a post that was to short with a much to vague description by giving me directly a list of improvements. So thanks for your work on this! ?
  7. Change Default Language to be None-English | Walk Trough When you start a new (single) language site and the default language shouldn't be English, you can change it this way: Go to the modules core section: Select the Language ones by the filter function: We have four language related modules here, but for a single language site in none english, we only need the base module, named "Languages Support". So go on and install it. After that, you can leave it, ... ... and switch to the newly created Language section under SETUP: Select the default language Enter your new language name or its Shortcut and save the page. I will use DE for a single language site in german here as example: Now I go to the ProcessWire online modules directory, down to the subsection for language packs and select and download my desired (german) one: After downloading a lang pack as ZIP, I go back into my SETUP > LANGUAGES > default language page in admin, select the downloaded lang pack ZIP and install it: After the ZIP is uploaded, the files are extracted and installed, most of my screen is already in the new default language. To get all fully switched, we save and leave that page, ... ... and completely logout from the admin. Now, of course, we directly login back, ... ... and see, that now also the cached parts of the admin have switched to the new default language. ? That was it for a single language site in none english. If you want to have a multi language site, just add more languages to the SETUP > LANGUAGES section. When using a multi language site, I think you also want to use multi language input fields, and maybe different page names for your language page pendents. If so, you need to go into MODULES > CORE > filter LANGUAGE and install what you need or want to use of it, (if not already done). Thanks for reading and happy coding, ?
  8. Hi Florian, I (temporary) have unhidden the post above yours with a walk through screenshot series. Have a good restart and fun with building your site! ?
  9. That, for example, may not work for people who don't like much reading. Can be that those people just don't see or get what you want them to, also if you explicitly have done it for that reason. I think it depends a lot, or only, on the use case, the target audience and its implementation, ( and sometimes maybe plus what your customer want to have ) ? Haha, yep. Now its one of my favorites, I never would have read all quotes when they where listed top down. But with the carousel, I was curious about every next quote. @ryan Very well done redesign. I know this site for some time now and have a feeling that your customers do know their target audience very well, and do and like to do their own jobs in more depth than many people may do. Seems to me that this is one of their essentiell points. - I am a bit envious of the way you work together and would like to work with (more) such clients too. But they really seem to be very rare. ? Ah, and I sometimes like carousels.
  10. Change Default Language to be None-English | Walk Trough When you start a new (single) language site and the default language shouldn't be English, you can change it this way: Go to the modules core section: Select the Language ones by the filter function: We have four language related modules here, but for a single language site in none english, we only need the base module, named "Languages Support". So go on and install it. After that, you can leave it, ... ... and switch to the newly created Language section under SETUP: Select the default language Enter your new language name or its Shortcut and save the page. I will use DE for a single language site in german here as example: Now I go to the ProcessWire online modules directory, down to the subsection for language packs and select and download my desired (german) one: After downloading a lang pack as ZIP, I go back into my SETUP > LANGUAGES > default language page in admin, select the downloaded lang pack ZIP and install it: After the ZIP is uploaded, the files are extracted and installed, most of my screen is already in the new default language. To get all fully switched, we save and leave that page, ... ... and completely logout from the admin. Now, of course, we directly login back, ... ... and see, that now also the cached parts of the admin have switched to the new default language. ? That was it for a single language site in none english. If you want to have a multi language site, just add more languages to the SETUP > LANGUAGES section. When using a multi language site, I think you also want to use multi language input fields, and maybe different page names for your language page pendents. If so, you need to go into MODULES > CORE > filter LANGUAGE and install what you need or want to use of it, (if not already done). Thanks for reading and happy coding, ?
  11. Ok, I have read that linked post. But one question is: What kind of default URLs do we get in a multilanguage site when following @dotnetic's suggestion. (@Jens: ?) I have created a series of screenshots, a full walk-through, of my suggested way, but I don't want to publish it, if it wouldn't be correct or if there be a better way. So here are my questions: When I only want to have a single language page in none english, what is to do then? How will the page pathes urls work out then with a second language set? When I want to have a multi language site with none english default, but with english as second lang, what is to do? How will the pages URLs work out for the none english default and the english sub language? EDIT: @bernhard, you was a bit faster, but I have more in depth questions. ?
  12. Summary: When you start a new site and the default not should be english: 1) enable languages support 2) set Title / Label of the default language to your desired none english native language, (e.g. 'Deutsch' (German)) 3) drop in the none english language pack (for admin backend) into the default language, (e.g. german langpack) Now you are ready to start with a single language site of your choice. If you want to use a multi language site, you now can add as many additional languages you want. If one of them should be english, you add it, but do not need to apply a language pack. 4) add a new language to it and drop in a language pack for any none english language or simply don't drop in a language pack to get the english version (but not as the default one!) For single language sites you only need to enable languages support, NOT language inputfields!, NOT language pagenames!, only basic language support, - to be able to change the default languages name and its lang pack! Of course, if you plan a multilanguage site, you also will need language pagenames and language inputfields, but not if you only need a none english backend. ? So, if you know at the beginning of a new site / project what has to be the default language, it is done with a snip. Only disadvantage is, if you need to switch the default language later on, when already content was filled into a site. These seems to be very rare cases in real life. And for that I think have read a complete step by step guide from @BitPoet within the last two or three month somewhere. (Is this right @BitPoet ? and sorry for ping you here) You also can read it here:
  13. Ok, I should have used that. ? Very nice! It's also monochrome gray. You have left the country name labels in english, all other labels seems to be in german. What was/is the reason for this?
  14. Hi Moritz, many thanks. I had no explicit settings for tileSize and zoomOffset in my script. I only had maxZoom, id and accessToken. Also I don't no if I get vector or raster tiles ATM. But simply adding your suggested settings already worked for me. Yeah! ? Now I know that it is possible (for me) to go this way with a customized map and can go more in depth to explore how to setup it all well. (Yesterday I struggled on this and wasted some hours.)
  15. Thanks Robin. But unfortunately this isn't it. If I set the font sizes there to maximum, they are displayed way to small in my webintegration. It is like the whole map is scaled down 2 or 3 times, not only font sizes.
  16. Hi, has someone used the mapbox studio to create an own map design? I tried it and see in the mapbox studio my map like this: And when calling this design on the webpage, it is shown way to small: Independent of the zoom factor of the map, the fonts would be at the same readable size. But in my web implementation its always way to small. When I use the zoom in, they shortly popup greater and then directly downsizes. Does anyone knows what I'm doing wrong?
  17. Ok, when working with image fields, you have many useful functions right with the core image field, and / or you can use third party modules. At first, you should enable the imagick rendering engine under modules > core > image. (Your webserver need to support this) Also you can enable the animated gif engine. The engines get invoked by inspected image filetypes. It do no harm to have more then the default fallback based on GD-lib. With the core image fields you can enable/disable a lot of features, like limiting the amount of images, allow upload of multiple images via ZIP, make use of focus point & zoom!, and many more. When it comes to cropping, you have many different ways to choose from. I prefer using the focus point and template code, assisted by PIA. You can use the built in crop functionality for manually create and name crop variations, but if you do, go and add the ImageCropRatios module to the toolbox. With it you can define fixed ratios. Another way can be to use the CroppableImage4 module. (module board of CAI3) With it you can define crop ratios per template basis. Also interesting, the CAI4 extends the core image field, what lets you use all functionalities in one field. You can make use of the focus & zoom in one template, and use predefined crops in another. If you once have a need for individual image manipulation, there is a module too. Thats the toolbox that I use or select from, but there are a lot more in regard of the variation filenames, EXIF data. There are modules that create a lightbox gallery out of the box, and more. But best is to know how the core pageimage work, in template scope and elsewhere! ---------------------------------------------------------------------------------- More: https://modules.processwire.com/modules/process-media-manager/
  18. Hi @Greg Lumley, welcome to the forums. This is funny, for me it is the other way round. Coming from photography I more and more moved into the field of programming. ? If you don't mind, I can point you to some spots and third party modules in the context that I, as a photographer, find very useful in PW.
  19. have you tried to double click one trash icon? Should do the trick. (since PW version 2.2?)
  20. @FlorianA maybe there is / was a misunderstanding? (I haven't read the thread, only the last posts) You are able to do: sites only in german, sites with german as default language, and (multiple) other language(s) added in ProcessWire with a snip, -- IF you start a new site right with the desired default language. Then your users only have to fill in the german fields, (and only optional other language(s)).
  21. Hey, I would do a type check on the return of banner->getRandom(). You do not check if there is always at least one image available. Or just temporary try this for a while and see if it behaves the same with the log filling: $random = $page->getUnformatted("banner")->findRandom(1); if(0 < count($random)) { $thumb = $random->first()->size(200, 200); echo "<a href='$thumb->url'>"; echo "<img src='$thumb->url' alt='$thumb->description' />"; echo "</a>"; }
  22. Hi @Martijn Geerts (and others), I updated the module and fixed the issue in context of the user template you reported. Many thanks! I then faced an issue with edit permission in context of user template with the process module. Example use case: Given the case there is a CAI4 field added to the user template A role, (we call it author here), has the permission to work with CAI4 fields: "croppable-image-4" And the author role is allowed to manage the CAI4 image(s) on their own profile page, (besides password and email address or AdminTheme settings) It does NOT have view and edit rights on the user template! That's how I think it is or should be the common use case. When I set it up like above, everything is working fine (now), except the CAI4 editor hasn't opened in a modal, but in a new tab. When I gave view and edit rights for the user template to the author role, it loaded into the modal popup. But that is not what we want to do. What seemed to be missing was the modal.js. It gets loaded for editpages where a user has regular edit rights via a pages template, but this is not the case when a user has rights to manage some profile properties. It would be nice if someone can confirm that this is expected behavior and that my approach here (and here) is correct. Updated the module on Github
  23. ? love this one! Very nice. I have tested it and found out, that it works the same across the core image field, the CAI3 and CAI4 image fields. ? Unfortunately ATM for me it only works with the tags setting "user by text input", and not with any setting of predefined tag lists. ------ And, if you don't mind, would it be possible to set opacity to something like 0.3 or hide the labels completly, while the user is using the zoom/focus function? (When the thumb has focus, or has focus and mouse-down or something that like)? This is not really necessary. It would just be the missing 1% to bump it from 99% to 100% perfect. ?
  24. done. ?
×
×
  • Create New...