-
Posts
4,077 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
Hi @teppo, I'm not able to react quickly to this. I will try to investigate and / or set up an in-depth-test for that issue and want to take in some of the images where @bernhard and / or @Robin S solutions worked fine. Just trying to get a new working solution for all situations. But I only can schedule this after the 22. december, unfortunately not earlier. ? @teppoCan you PM me a zip with the wrong original image, and maybe one corrected from PW, or only the original image and what you have changed in the code so that it comes out correctly?
-
How do I link to a page with a language in a multilingual website?
horst replied to kaz's topic in General Support
Does this behave the same with internal (relative) links and external (httpUrl) links? Haven't tried, just a thought. -
Wrong redirection for page with name that equals language root name
horst replied to gebeer's topic in Multi-Language Support
Hi @gebeer, Not really knowing an answer, but first I would post this in github issues so that it gets ryans recognition. And one idea came to my mind as workaround until a solid solution is known, would it be possible to use in pw the /cn/asia/... structure and use apache mod_rewrite to make it read /cn/cn/... ? Have not tried, just an idea. -
Selector weirdness when searched value has zeroes and dots
horst replied to MSP01's topic in General Support
It looks like the numeric chars aren't seen as text but as number and gets cleaned up like trailing zeros in decimal sector have no meaning. So I bet if you have something like 7.50000 it comes out as 7.5 but 7.50001 will come out as 7.50001. I'm not sure if this sort of clean up (sanitizing) is done by PW or by MySQL. ?? -
Selector weirdness when searched value has zeroes and dots
horst replied to MSP01's topic in General Support
Have you also tried it with the $sanitizer->selectorValue()? Does it behave the same or different? -
How to prevent backend generating default thumbnail images
horst replied to rushy's topic in General Support
Hi @rushy, you also first may try to set the $config->adminThumbOptions in a way that matches already existing image variations: Above are the default settings from the wire/config.php. Use this as starting point and copy it into your site/config.php and adjust as needed. -
Nice site! I'm thinking if it would be a good idea to spent the Especialidades main menu point some sort of dropdown with all subpages listet?
-
Most optimal place to store built assets?
horst replied to Jonathan Lahijani's topic in General Support
As the name says: built assets ? -
The PHP function substr() can be used to start after the 4. character. You can use it in your template file or create a little textformatter module. (Sorry im on mobile, no link to the PHP manual provided.)
-
Sharing authorization between ProcessWire installations
horst replied to Ivan Gretsky's topic in General Support
I want to have a copy, if I can. ? ? -
Loading time optimisation with lots of images
horst replied to michelangelo's topic in General Support
the following is a transparent 1 px gif: <img src='data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' ... If you use this as default src, together with the width and height attributes, the browser engine is much earlier ready (doc-ready). You ommit one extra server request per image, as the images default data is already available within the HTML. And the default data is thousand times smaller this way. All that speed up things drastically. To your other points: 2) As I understand the concept of srcset, you should use / load the smallest fit, and if the image should be zoomed / scaled up afterwards, the browser handles additional (re)loadings. -
If I remember right, in such cases I use a URL field for external URLs and a page select field for internal (multilanguage) links. If the URL field is empty, the page select field is shown, if a (external) URL is given, the page select field is hidden (showIf). (In the notes of the URL field is a hint that clearing the field will show the internal page select field). In template files I first check if there is given a URL or if that is field empty, and according to that I display external or internal URL.
-
Loading time optimisation with lots of images
horst replied to michelangelo's topic in General Support
<img loading="lazy" src="https://comeinyourewelcome.nl/site/assets/files/1150/schermafbeelding_2021-09-28_om_00_35_23.320x0.png" srcset="https://comeinyourewelcome.nl/site/assets/files/1150/schermafbeelding_2021-09-28_om_00_35_23.320x0.png 320w, https://comeinyourewelcome.nl/site/assets/files/1150/schermafbeelding_2021-09-28_om_00_35_23.480x0.png 480w, https://comeinyourewelcome.nl/site/assets/files/1150/schermafbeelding_2021-09-28_om_00_35_23.768x0.png 768w, https://comeinyourewelcome.nl/site/assets/files/1150/schermafbeelding_2021-09-28_om_00_35_23.1240x0.png 1240w, https://comeinyourewelcome.nl/site/assets/files/1150/schermafbeelding_2021-09-28_om_00_35_23.1800x0.png 1800w" sizes="100vw" alt="Image from Untitled by Allen & Overy" width="320px" height="485px" > This is your code from the static HTML. When I look into the browser inspector, all your images for 320w are loading highres images around 2.500 px width and more. ?? What looks not good to me is sizes="100vw" ?? I would expect something like sizes="auto". Also you uses PNG. Why not JPEG or WEBP? Loading 5MB per image also on small browser sizes. Uuups! The above was inspected with disabled javascript. So after correcting the base markup you also need to inspect what the JS does afterwards. Further optimization could be: Using a small data-image as default, like a 1px transparent gif or are more individual one in JPEG or PNG: src="data:image/jpeg;base64,... ... ..." -
Yes, you should turn on debug in your site/config.php for that: $config->debug = true; So, an error logging is always running, but with $config->debug set to true, it is more verbose. All generated log files are located under /site/assets/logs/ and you can view them paginated in the admin under setup > logs > Don't forget to revert $config->debug back to false, if the site is public online! EDIT: If you would have changed the admin thumb size after you have added the 500 to one page, then the page editor would try to regenerate all thumbs at all. (just a possibility, but you haven't changed it, I believe) I'm interested what you will find out. I have pages also with 300+ 400+ and a view with 500 images in one field, but all of them have lesser (longer) PHP timeout restrictions.
-
SSL error when loading files on demand (certificate verify failed)
horst replied to bernhard's topic in General Support
It works for me on windows too. (The image file is a PNG with file ending jpg, but the download succeeds without any issue.) -
This can be used to avoid sessions on the front end, or on some pages. (And allow them for the admin, where it is needed) You should check this site in regard of its GDPR rules / announcements. (In regard that you not now has enabled sessions where it should not be.) 0400 is better == more secure. If you need to update the site/config.php in the future, you THEN can set it temporary to 0600 for your changes, and directly afterwards back to 0400.
-
Ooh. Than I've thought to complicated. ?
-
I don't (know) ? ??
-
I do such things with a small javascript or AJAX call on doc ready or similar. Or sometimes in the head section of the HTML page, depending what is needed. So you may add a small JS snippet directly after the opening body tag that checks the user preferences and according the result, add or remove a css class from/to body. (?)
-
Ok, I see. Then you should post an issue on github.
-
I cannot find any example with newline character in the docs? Do I oversee something? I thought that escape characters are not supported by the translation. If I'm right, maybe it should be written explicitly in the docs too. I think the right usage is or can be like this: // use %s with sprintf() $out = sprintf(__("It's time for you %sto get to the party."), "\n");
-
Hi, I have following situation with a small local hosting company that do not give access to (common) service panels for domain administration: There are two existing domain names example-a.com and example-b.com. example-b.com is an old site that does not have an own webspace any longer, as its content was years old and unmaintained. The hosting company has mapped both domain names to the same webspaces webroot directory. (at least they told so) We have build a new site under example-a.com and it is hosted correct in the webspace. Now we want to detect all incoming from example-b.com and redirect to URL example-a.com/subpage5/ To achieve this we added the following line into the root .htaccess file: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^example-b\.com [OR] RewriteCond %{HTTP_HOST} ^www\.example-b\.com RewriteRule ^(.*)$ https://www.example-a.com/subpage5/ [L,R=301] ... But unfortunately it only redirects to the webroot (https://www.example-a.com/) and not to the /subpage5/. Does anybody has an idea why this behaves or how I can handle it better?