Jump to content

jacmaes

Members
  • Posts

    285
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by jacmaes

  1. @bedak might be referring to images in CKEditor fields, which would all probably benefit from being lazy loaded. By the way, it looks like we developers should not be using the "loading" attribute on iframes until it's part of the spec. Yes, Chrome has implemented it, but they went ahead as usual without much consideration for cross-browser interoperability ("innovation first, standards later" seems like their M.O., even if that's caused problems a few times before).
  2. Thanks guys. I'll see what I can do this weekend, if I finally manage to have some free time. PS: although I built the following page before this module, it does use the lite-youtube-embed script, so you can check how it looks and how fast the page loads with 14 videos: https://www.spainculture.us/digital-projects/14-days-14-artists/
  3. This is my very first module, and I'm sure it needs a lot of improvements, so I'd like to get some feedback. I've kept it as simple as possible to fit my basic needs. Adapted from Ryan Cramer's TextformatterVideoEmbed, this TextFormatter module replaces plain YouTube links pasted in a CKEditor field with Paul Irish's blazing fast Lite YouTube Embed script: https://github.com/jacmaes/TextformatterLiteYouTubeEmbed Why? The Lite YouTube Embed script is indeed a lot faster than the standard iframe embed. The difference is pretty spectacular when you need to embed a series of videos. It's also more private as it uses youtube-nocookie.com (so no need for a cookie banner).
  4. The script above is supposed to open the privacy in a modal. That's really the only added benefit I see here.
  5. Pretty sure it's in your php.ini file. See here: https://studioncreations.com/blog/increasing-wordpress-8mb-limit-with-mamp-pro/ http://blog-en.mamp.info/2009/09/increase-php-memory-limit-with-mamp-pro.html
  6. I believe that it's precisely what this script is supposed to do: embedding a button. https://www.iubenda.com/en/help/216-privacy-policy-standard-embedding It seems like overkill to me: it's a just a link after all. I usually just convert it to a plain link, no script required: <a href="https://www.iubenda.com/privacy-policy/xxxxx/legal">Politique de confidentialité</a>
  7. Hi @Gadgetto Thanks for your effort with this module and making it available to the PW community! I'm installing it right now to give it a try. I've noticed that the module configuration still refers to Snipcart v.2 when version 3 has been out for a few weeks now and looks stable enough. Among other things, the jQuery dependency is gone so I guess you could remove that option, and update the links to the Snipcart JS and CSS files.
  8. @Peter Knight Plesk support for Webp is coming shortly: https://support.plesk.com/hc/en-us/articles/360012609933-Do-Plesk-PHP-packages-have-WebP-support-
  9. I can confirm that I’ve also reached exactly the same conclusion this morning. Using only the useragent seems to keep the constant disconnections away.
  10. @Rudy Can you explain in more details or post a screenshot of your settings? Disabling cache with the following page rule for the admin URL actually makes things a lot worse…
  11. I recommend Sarah Edo's grid generator. This is what I used for my quick demo: https://cssgrid-generator.netlify.com/
  12. Here's a demo that loosely reproduces your screenshot: https://codepen.io/jacmaes/pen/qBWJrRY
  13. Not sure what you mean with "freely positioned". In any case, you might not be very familiar with CSS grid, but they can be freely positioned on the grid: They don't have to be next to each other, there can be gaps as in your screenshots. My example is slighly misleading as they are grouped together, similar to a masonry layout.
  14. As @entschleunigung said, CSS grid looks like a good solution. This codepen can get you started.
  15. Have you tried following these instructions to add WebP support to MAMP?
  16. @horst, as mentioned here, it looks like your module is not compatible with the new WebP support added in 3.0.132. Or am I doing it wrong?
  17. @adrian That's what I first thought too, but no, it's not generated in the corresponding "files" folder. Digging a bit further, it looks like it does not work with @horst's CroppableImage 3 Module, at least in the way I expected it should. So: $page->image->first->getCrop('landscape')->webp->url; does NOT work. But: $page->image->first->webp->url; does generate a Webp variant correctly.
  18. I have WebP support enabled in GD (PHP 7.3), but $image_field->webp->url still returns a JPEG file. Anything I'm missing? Is there something to add in the config.php file?
  19. @Peter Falkenberg Brown I had the same question. Ryan told me that the single version is in fact part of ProDevTools package. I ended up buying the dev version.
  20. Thanks for sharing. It's nice to see you're using the newer API additions such as $page->if() and setting(). I get excited when I learn about these from the blog posts, but then I forget to use them in my new projects…
  21. Here's @Robin S code adapted to produce the following thumbnail navigation (semi-transparent thumb #98 is the current one): <?php // Number of thumbs to show $limit = 9; // Get the number of visible siblings $num_siblings = $page->parent->numChildren(true); // The default start value is zero $start = 0; // If the number of siblings is greater than the limit then we need to adjust the start value if($num_siblings > $limit) { // Get the halfway point of the limit $half_limit = floor($limit / 2); // Get the index of the current page relative to its siblings $index = $page->index(); // Adjust the start value to keep the current page within the sibling links if($index > $half_limit) $start = $index - $half_limit; if($num_siblings - $start < $limit) $start = $num_siblings - $limit; } $items = $page->siblings("start=$start, limit=$limit"); // Next page and previous page relative to current page $next_page = $page->next(); $prev_page = $page->prev(); // Next and previous SVG icons $left_arrow = "<svg role='img' aria-labelledby='previous-icon' class='icon icon--inline' height='24' width='24'><title id='previous-icon'>Next photo: {$page->prev->title}</title><use xlink:href='#icon--left-arrow'></use></svg>"; $right_arrow = "<svg role='img' aria-labelledby='next-icon' class='icon icon--inline' height='24' width='24'><title id='next-icon'>Previous photo: {$page->next->title}</title><use xlink:href='#icon--right-arrow'></use></svg>"; ?> <?php if($items->count > 1): echo "<div class='thumb_gallery'>"; if ($prev_page->id) echo "<a class='thumbnail' href='$prev_page->url'>$left_arrow</a>"; foreach($items as $item): $number = $item->index() + 1; $current = null; if ($item == $page) $current = " aria-current='page'"; echo "<a$current class='thumbnail' href='$item->url'>"; echo "<img class='responsive-images thumbnail__image' src='{$item->photo->size(150,150)->url}' width='75' height='75' alt=''>"; echo "<span class='thumbnail__label'>$number</span>"; echo "</a>"; endforeach; if($next_page->id) echo "<a class='thumbnail' href='$next_page->url'>$right_arrow</a>"; echo "</div>"; endif; ?> I hope this can help someone else. Thanks again @Robin S !!
  22. Great, thanks @Robin S! Your example looks like what I'm looking for. I'll give it a try early next week and report back with my adapted solution, if I manage to make it work.
  23. @LostKobrakai that helped, thanks. @elabx 's suggestion still retrieves unexpected results: Photo #1: nothing shown, as expected. Photos #2 to #6: work. Photo #7: shows only 4 previous images instead the of the expected 6. Photo #8: shows only 3. Photo #9: shows only 2. Photo #10: shows only 1. Photo #11: works. Photos #12 and above: only shows first 10…
  24. Thanks @elabx for pointing me to prevAll(), which I had not encountered yet. Unfortunately, the order is not respected and the results seem also random (sometimes it retrieves fewer results than expected).
×
×
  • Create New...