Jump to content

jonatan

Members
  • Posts

    90
  • Joined

  • Last visited

Everything posted by jonatan

  1. Awesome @bernhard! You're the man! ? The find (include=all) did it. Worked perfectly! Thank you so much!! I had no idea about the d() debug function! So extremely useful! Once again so very impressed by PW's enjoyable logic! All the best, Jonatan
  2. Hi! ? I tried searching for this, but couldn't find anything on on it... How can I get the deactivated / turned off repeater items? Why? Because I want to use it as an "archive" function, so that the toggle-off makes them show up under "previous events", and when toggled-on they'll show up under "Current events" All the best, Jonatan.
  3. Nevermind, Fixed it: var postnum = <?php echo $postsnum; ?>; // Show spinner if (this$1.total < postnum){ this$1.$loading.show(); } ?
  4. Oooonly thing now though, is that the loading element still keeps showing up, when there's no more content to load ?
  5. HEUREKA!!! ? ? ✨ No idea what the difference is... but I updated the code and without even looking at the log it just worked perfectly now!! ???? Tadaaaa: rec-Wi-Fi High.mp4 I am so so so glad for all of the massive help that you've given me Criss @nbcommunication!!! ? Really could never have gotten even close to getting it working without you and the nice module! I am so glad! Can I please buy you a beer or a coffee?? ?☕I'd love to thank you somehow! ? All the best, Jonatan.
  6. Absolutely love your website @diogo! I've looked at it multiple times for inspiration! Such a nice and inspiring portfolio!
  7. Hi @nbcommunication Criss! ? Thank you so much once again! I updated the module, cleared the module cache, and pasted in your new code. But.. It's still the same.. It loads every second "batch", and the last batch is not loaded (and it just keeps showing the loading). Any ideas what might be wrong? ? All the best, Jonatan
  8. Really interesting @Peter Knight! Yup I think it's due to this https://knowledge.hubspot.com/integrations/install-the-hubspot-wordpress-plugin https://wordpress.org/plugins/leadin/ The official WordPress Hubspot plugin. It does kinda seem though from the features list that it's mostly just a Hubspot dashboard in Wordpress.. : Dashboard: view your HubSpot reporting dashboards to monitor newly created contacts. Contacts: a single contact database to manage detailed analytics on all your contacts, leads, and customers in one location. Associate contact records with companies, deals, and more in your CRM. Lists: create segmented lists to use when sending a marketing email campaign or enrolling contacts in your workflows. Forms & pop-ups: create mobile-responsive forms and pop-up forms to use on your website. You can add follow-up emails to specific forms to nurture your leads. Live chat & chatbots: add live chat to your website and let site visitors chat with you in real time. Set up automated chatbots to respond to your visitors when you aren’t online. Email marketing: create clean and responsive emails in the intuitive drag and drop editor. You can even include personalized content and subject lines based on your recipients' known contact properties. Built-in analytics: analyze website performance and HubSpot forms to see which channels are driving the most leads by clicking the Dashboard link in the plugin menu. Track the performance of your team with sales dashboard reports. Integrations: integrate your HubSpot account with over 300 integrations, including Stripe, Zapier, and more. Learn about featured integrations and check out a full list of integrations in your account. This must be set up in your HubSpot account. I guess that they could probably just do it all using the native Hubspot admin.. Maybe I can convince them to go PW and not WP ? Do you know what CRM solution they ended up using? ?
  9. Amazing @Jonathan Lahijani? Releasing it? ?
  10. Also exciting stuff here: Seems @Jonathan Lahijani might be brewing something really big!
  11. @Jonathan Lahijani Extremely extremely exciting stuff! Any news? So many I think want this! Fx newest All the best, Jonatan
  12. @KrlosHere's a great blog post about it by @Michael van Laar https://digitalardor.com/articles/basic-setup-for-content-blocks-in-processwire/ I just very recently, during this week, upon processwireficying my, previously static but now dynamic, Bootstrap based basic personal portfolio site, implemented a homecoocked DIY "page builder" into it: jonatanronsholdt.dk. It equeally to what you want features different customized flexible layouts per portfolio item / post. ? As it's only made for my own use it's not made super "user friendly" (cause too lazy to do so when it's only myself who'll see it ofc) but hey, it's working! I think in general the whole idea of more support for flexible layouts is super interesting in terms of PW! Aka pagebuilders. Maybe a future amazing core module hmm?.. PWs own Gutenberg(WP) ? Or maybe it doesn't fit with the PW filosophy of not dictating any part of the frontend markup.... Well I'm just a noob so.. Haha. Would love to see a new philosophical discussion on this "generating dynamic / flexible modular blocks page content using non fixed templates /page builders with column features etc" subject hough maybe featuring some of the PW forum stars such as above @bernhard and all the other amazing PW gurus alike. (CSS tricks different CMSs content blocks article) But mine is built using the PageTable field type. Basically it'd just be more intuitive and prettier, read better ui friendliness for editor, using the payed Pro fields Repeater Matrix ? But same basic concept: Pagesfield: (Image, paragraph , Image, columns, image, image, columns end, paragraph) And each "block type" is actually just a page (the PW everything as a page philosophy) with a template which only simply generates the html for the block = <img ... /> <p>... </p> <img ... /> <row> <col><img ... /> <img ... /> </col></row> <p>... </p> I'd be more than happy to share my sloppy homebrew with you if it could be of any help. (or you know.. Use Michael's recipe). Though if you're any sort of experienced as a php développer you'll probably come up with something far more pretty than my noob code haha. All the best, Jonatan Ps if you go with pagefieldtype (though the profiled repeater matrix is probably way better for editor userfriendliness) I found this useful
  13. Old Post but.. Any news since 2018 on this? I have an upcoming client which say that they need to run WP because of Hubspot CRM integration... I haven't been given any further clues though about exactly why though yet.. Anyone using it or similar? ?
  14. Got it all working pretty good now actually! ? rec sasha website instafeed-Broadband High-Broadband Low.mp4 <script> var instagram = { $el: {}, // Where the items go $loading: {}, // The loading spinner total: 0, // The total number of items init: function() { this.$el = $("#instagram"); if(!this.$el.length) return; // Add the spinner this.$el.after("<div id='instagram-loading'><span class='loadertextcontainer'><b class='loadertext'>loading<span>_</span><span>_</span><span>_</span></b></span></div>"); this.$loading = $("#instagram-loading"); this.$loading.hide(); // Get the first batch of items this.get(); }, get: function() { var this$1 = this; // Show spinner this$1.$loading.show(); // Request $.getJSON(window.location.href, function(data) { // Hide spinner this$1.$loading.hide(); if(!$.isArray(data) || !data.length) return; // If no items do not render var items = []; data.forEach(function(item, index) { switch(item.type) { case "VIDEO": items.push(this$1.renderItemVideo(item.src, item.alt, item.href, index, item.poster)); break; case "CAROUSEL_ALBUM": var out = ""; for(var i = 0; i < item.children.length; i++) { var src = item.children[i].src; if (i <= 0) { out += "<a class='carousel-item active fb-gallery-ig' data-height='600' data-caption='" + item.href + "' href='" + src + "'>" + "<div style='background-image: url(" + src + ")' class='pics'></div>" } else { out += "<a class='carousel-item fb-gallery-ig' data-height='600' data-caption='" + item.href + "' href='" + src + "'>" + "<div style='background-image: url(" + src + ")' class='pics'></div>" } +"</a>"; } items.push( "<div data-interval='3000' class='carousel slide carousel-fade col-12 col-sm-6 col-md-4 p-3 pics' data-ride='carousel' id='instagram-item-" + (this$1.total + index) + "'>" + "<div class='carousel-inner'>" + out + "<a class='carousel-control-prev' href='#instagram-item-" + (this$1.total + index) + "' role='button' data-slide='prev'>" + "<span class='carousel-control-icon-bg' aria-hidden='true'></span>" + "<span class='carousel-control-prev-icon' aria-hidden='true'></span>" + "<span class='sr-only'>Previous</span>" + "</a>" + "<a class='carousel-control-next' href='#instagram-item-" + (this$1.total + index) + "' role='button' data-slide='next'>" + "<span class='carousel-control-icon-bg' aria-hidden='true'></span>" + "<span class='carousel-control-next-icon' aria-hidden='true'></span>" + "<span class='sr-only'>Next</span>" + "</a>" + "</div>" + "</div>" ); break; default: // IMAGE items.push(this$1.renderItem(item.src, item.alt, item.href, index)); break; } }); var count = items.length; if(count) { // Append items to the container this$1.$el.append(items.join("")); // Attach listener $(window).scroll(function() { if($(window).scrollTop() == $(document).height() - $(window).height()) { this$1.get(); $(window).scrollTop($(window).scrollTop()-1); } }); // Update total this$1.total = this$1.total + count; } }, function(e) { this$1.$loading.hide(); console.log(e); // ERROR }) }, renderItem: function(src, alt, href, index, poster) { return "<div class='col-12 col-sm-6 col-md-4 p-3 pics' id='instagram-item-" + (this.total + index) + "'>" + "<a class='fb-gallery-ig' data-height='600' data-caption='" + href + "' href='" + src + "' data-alt='" + alt + "'>" + "<div style='background-image: url(" + src + ")' class='pics'>" + "</div>" + "</a>" + "</div>"; }, renderItemVideo: function(src, alt, href, index, poster) { return "<div class='col-12 col-sm-6 col-md-4 p-3 pics' id='instagram-item-" + (this.total + index) + "'>" + "<a class='fb-gallery-ig' data-height='600' data-caption='" + href + "' href='" + src + "'>" + "<div style='background-image: url(" + poster + ")' class='pics'>" + (src !== poster ? "<div class='overlay-video-icon'></div>" : "") + "</div>" + "</a>" + "</div>"; } }; $(document).ready(function() { instagram.init(); }); </script> Only problem now is that every second "batch" of the pagination is not shown... Maybe some (to the quite so much more trained eye) obvious mistake in my poor copy of your code?? ? (– the limit is set to 9 btw – guess it shouldn't really make a difference though?) And... then when it gets to the last "batch" it keeps showing the loading section. Not quite sure how to make it not show when the last batch has been loaded? Hope that you might have some brilliant input once again! Thank you so much once again! All the very best, Jonatan
  15. Yup! ? That did it @nbcommunication Criss! As said my JSON / AJAX knowledge is pretty much equal zero. The scroll to bottom load function is not quite working though but I'll try and look into that and see if I can figure anything out ?
  16. It wouldn't be possible to do something like "getMedia(next(10))" sort-of thing? A module function call that would serve the next x images? (And then it'd ofc not serve anything if it's the last pagination page) And then I could maybe just do some simple javascript like "if page is scrolled to bottom -> php media = getMedia(next(10)); echo (media);" - if you get that drift? Or maybe this kind approach would have a lot of flaws that I can't see? (Maybe some caching problems or something like that?) All the best, Jonatan
  17. On the bright side!: It seems though that now the cache function is working. whenever refreshing the page, it doesn't seem to generate a new API call on the Rate Limiting page! ?
  18. Update: I tried including the UIKIt css & js CDN and copy pasting your exact php & javascript lazy load code from the readme, and also then it only got me to the spinning / loader part of the script.. hm.. (Warning: javascript, ajax and json is not really my game though – can't really say that php is either though haha)
  19. Hi @nbcommunication Criss! ? Well hopefully better luck with them tatties a bit later then! ☀️? Your video preview looks just fabulous! ? Just what I need ? And I must say I'm continuously impressed by your enthusiasm put into this module! I've updated the module and crossed my fingers... But.. I tried your suggested code and not that much happened though ? <body> <?php include "../templates/main/bgimg.php"; ?> <div class="container"> <?php $itm1act = "active"; include '../templates/main/nav.php'; ?> <?php $instagram = $modules->get("InstagramBasicDisplayApi"); $username = "sasha_lindegaard"; $account = $instagram->getProfile($username); $postsnum = $account["media_count"] ?? 0; ?> <div class="row"> <div class="col-12 text-center mb-3"> <a href="https://instagram.com/<?= $username ?>/" target="_blank" class="marked"><h3 class="marked my-5 instalink"> @<?= $username ?></h3> </a> <?php if($postsnum): ?><h5 class="marked-dark"><?= $postsnum ?> POSTS / OPSLAG </h5><?php endif; ?> </div> <?php $instagram = $modules->get("InstagramBasicDisplayApi"); // The pagination cursor is reset if the request is not AJAX, e.g. when the page is loaded. if($config->ajax) { header("Content-Type: application/json"); echo $instagram->getMedia(); // ["json" => true] is inferred by $config->ajax die(); } echo "<div id='instagram' class='row'></div>";?> </div> </div> <script> var instagram = { $el: {}, // Where the items go $loading: {}, // The loading spinner total: 10, // The total number of items init: function() { this.$el = $("#instagram"); if(!this.$el.length) return; // Add the spinner this.$el.after("<div id='instagram-loading'>...Your choice of spinner!</div>"); this.$loading = $("#instagram-loading"); this.$loading.hide(); // Get the first batch of items this.get(); }, get: function() { var this$1 = this; // Show spinner this$1.$loading.show(); // Request $.getJSON(window.location.href, function(data) { // Hide spinner this$1.$loading.hide(); if(!$.isArray(data) || !data.length) return; // If no items do not render var items = []; data.forEach(function(item, index) { switch(item.type) { case "VIDEO": items.push(this$1.renderItem(item.poster, item.alt, item.src, index)); break; case "CAROUSEL_ALBUM": var out = ""; for(var i = 0; i < item.children.length; i++) { var src = item.children[i].src; out += "<a class='carousel-item' data-fancybox='gallery-ig' data-height='600' data-caption='" + item.alt + "' href='" + src + "'>" + "<div style='background-image: url(" + src + ")' class='pics'></div>" + "</a>"; } items.push( "<div data-interval='3000' class='carousel slide carousel-fade col-4 p-3 pics' data-ride='carousel' id='instagram-item-" + (this$1.total + index) + "'>" + "<div class='carousel-inner'>" + out + "<a class='carousel-control-prev' href='#_{$post->id}' role='button' data-slide='prev'>" + "<span class='carousel-control-icon-bg' aria-hidden='true'></span>" + "<span class='carousel-control-prev-icon' aria-hidden='true'></span>" + "<span class='sr-only'>Previous</span>" + "</a>" + "<a class='carousel-control-next' href='#_{$post->id}' role='button' data-slide='next'>" + "<span class='carousel-control-icon-bg' aria-hidden='true'></span>" + "<span class='carousel-control-next-icon' aria-hidden='true'></span>" + "<span class='sr-only'>Next</span>" + "</a>" + "</div>" + "</div>" ); break; default: // IMAGE items.push(this$1.renderItem(item.src, item.alt, item.src, index)); break; } }); var count = items.length; if(count) { // Append items to the container this$1.$el.append(items.join("")); // Attach listener // No idea if this works!!! $(window).on("resize scroll", function() { var next = $("#instagram-item-" + (this$1.total + count - (count < 5 ? 1 : 6))); if(!next.hasClass("seen") && this$1.inViewport()) { next.addClass("seen"); this$1.get(); } }); // Update total this$1.total = this$1.total + count; } }, function(e) { this$1.$loading.hide(); console.log(e); // ERROR }) }, inViewport: function(el) { // Untested, got the code from // https://medium.com/talk-like/detecting-if-an-element-is-in-the-viewport-jquery-a6a4405a3ea2 var elementTop = el.offset().top; var elementBottom = elementTop + el.outerHeight(); var viewportTop = $(window).scrollTop(); var viewportBottom = viewportTop + $(window).height(); return elementBottom > viewportTop && elementTop < viewportBottom; }, renderItem: function(src, alt, href, index) { return "<div class='col-4 p-3 pics' id='instagram-item-" + (this.total + index) + "'>" + "<a data-fancybox='gallery-ig' data-height='600' data-caption='" + alt + "' href='" + href + "'>" + "<div style='background-image: url(" + src + ")' class='pics'>" + (src !== href ? "<div class='overlay-video-icon'></div>" : "") + "</div>" + "</a>" + "</div>"; } }; $(document).ready(function() { instagram.init(); }); </script> <?php include "../templates/scripts/fancybox-settings.php"?> <?php include "../templates/main/footer.php"; ?> </body> Only got me as far as the "Your choice of spinner part" Any ideas? ? All the best, Jonatan.
  20. @nbcommunication Hi Criss! Sounds interesting! ? No worries though. Nothing very urgent ? If so, enjoy the garden! ?? It's been great in Denmark as well lately! ☀️ All the very best, Jonatan
×
×
  • Create New...