Jump to content

horst

PW-Moderators
  • Posts

    4,049
  • Joined

  • Last visited

  • Days Won

    86

Everything posted by horst

  1. How do you add the category to the member pages? Through which type of field? Options Select, Page Reference, ...?
  2. @Abe Cube please use the code input to post code: Example: <?php namespace ProcessWire; class TabExtension extends WireData implements Module { public static function getModuleInfo() { return [ 'title' => 'Foo test module', 'summary' => 'An example of creating a module', 'version' => 1, 'summary' => 'Display message when pages are saved', 'autoload' => true, ]; } public function ready() { $this->addHookAfter('ProcessPageEdit::buildForm', $this, 'addButtons'); } public function addButtons($event) { $page = $event->object->getPage(); if ($page->template == "bewerbung") { $form = $event->return; $inputfields = new InputfieldWrapper(); $tab = new InputfieldWrapper(); $tab->attr('title', 'Settings'); $tab->attr('class', 'WireTab'); $markup = $this->modules->get('InputfieldMarkup'); $markup->label = 'Settings'; $markup->value = '<p>Just a placeholder for some inputfields.</p>'; $tab->add($markup); $inputfields->add($tab); $form->add($inputfields); } } }
  3. @BillH You may have a look into the DBs table of an image field and check what numbers are set in the column "sort" before and after you opened, changed and saved or reopened a special page. If you have no DB viewer app at hand, you also can use a little debug script (cli script) to check this. Example script for CLI access, given the images field is named "images" and the page id of one problematic page is "1234": <?php namespace ProcessWire; include('./index.php'); $tablename = 'field_images'; $pages_id = 1234; echo '<pre>'; $query = "SELECT data, sort FROM {$tablename} WHERE pages_id={$pages_id}"; $pDOStatement = $database->query($query); foreach($pDOStatement as $row) { echo "\n{$row['sort']} :: {$row['data']}"; } echo "\n\nReady!"; exit(0); You may check if all image entries have a value in the column "sort", if it is a valid value, starting from 0 and is up counting, if it changes and when, etc. This may help a bit on coming closer to the issue. Do the older pages use the same images field and also the same template then the newer pages? If not, are there different per template settings for the images field? ...
  4. 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?
  5. Does this behave the same with internal (relative) links and external (httpUrl) links? Haven't tried, just a thought.
  6. 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.
  7. 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. ??
  8. Have you also tried it with the $sanitizer->selectorValue()? Does it behave the same or different?
  9. 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.
  10. 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?
  11. 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.)
  12. Also the use of the 404 Logger of JumpLinks module can fill up a DB drastically. There is a button available to clear that list manually.
  13. 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.
  14. 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.
  15. <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 &amp; 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,... ... ..."
  16. 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.
  17. The image field can handle this scale, but maybe your server seems not to be able to create 500 thumbnails in under 30 seconds? Thats the only thing that came to my mind. Or are the adminthumbnails already all there?
  18. It works for me on windows too. (The image file is a PNG with file ending jpg, but the download succeeds without any issue.)
  19. 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.
  20. Ooh. Than I've thought to complicated. 🤣
  21. 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. (?)
×
×
  • Create New...