Jump to content

jacmaes

Members
  • Content Count

    250
  • Joined

  • Last visited

  • Days Won

    2

jacmaes last won the day on June 28 2017

jacmaes had the most liked content!

Community Reputation

245 Excellent

About jacmaes

  • Rank
    Distinguished Member
  • Birthday 10/05/1973

Profile Information

  • Gender
    Male
  • Location
    Seville, Spain

Recent Profile Visitors

8,567 profile views
  1. Many, many thanks @flydev 👊🏻 and @kixe !!! That makes sense. I can confirm that both solutions work.
  2. I have a series of videos, and the following search form (translated into English here) that allows to filter these videos on the frontend: I've built a few of these search forms, but only with text fields, selects and radio buttons. Here I'm using an array with checkboxes ("Level" field above), and it's causing me grief when I try to paginate these results. I've done a lot of searching in the forum and spent too many hours to try to get it to work. Here's how I'm building the selector: <?php if(count($input->get)): // Level is an array. Code adapted from Ryan's snippet here: // https://processwire.com/talk/topic/3472-enable-pagination-for-search-results/?tab=comments#comment-38042 if($input->get->level) { $level = array(); foreach($input->get->level as $id) $level[] = (int) $id; // sanitize to INTs $level = implode('|', $level); // convert to 123|456|789 string, ready for selector } else { $level = ''; } $data = array( 'training_type' => array('=', (int) $input->get->training_type), 'duration' => array('=', (int) $input->get->duration), 'level' => array('=', $level), 'limit' => array('=', (int) $input->get->limit) ); $selector = ''; // iterate through the $data we made above to create a selector string foreach($data as $field => $a) { list($operator, $value) = $a; if(empty($value)) continue; // send value to the whitelist so that it can be used in pagination $input->whitelist($field, $value); // append to our selector string $selector .= "$field$operator$value, "; } $videos = $page->children("$selector"); When I hit search, I get the expected results. So far so good. The GET parameters are the following with the options selected in the screenshot above: videos/?level[]=1476&level[]=1477&training_type=1473&duration=1485&limit=10 $selector echoes the following as the "level" field is an array with a pipe character: level=1476|1477, training_type=1473, duration=1485, limit=10 Now, when paginating these results, the following page (page 2) shows these GET parameters: videos/page2/?level=1476|1477&training_type=1473&duration=1486&limit=10 And I think that's where the problem lies. The "level" field is "lost" and I'm getting more results than expected on subsequent pages. If I manually add "page2" to the initial results in the URL, just to test, everything works fine: videos/page2/?level[]=1476&level[]=1477&training_type=1473&duration=1486&limit=10 But how can I achieve this in code? Do I need to revert to "level[]=1475&level[]=1477" instead of "level=1476|1477" for the pagination to work correctly, and can you PHP gods illuminate me? Any help would be really appreciated, really.
  3. @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).
  4. 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/
  5. 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).
  6. The script above is supposed to open the privacy in a modal. That's really the only added benefit I see here.
  7. 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
  8. 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>
  9. 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.
  10. @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-
  11. 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.
  12. @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…
  13. I recommend Sarah Edo's grid generator. This is what I used for my quick demo: https://cssgrid-generator.netlify.com/
  14. Here's a demo that loosely reproduces your screenshot: https://codepen.io/jacmaes/pen/qBWJrRY
×
×
  • Create New...