Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Wexley: Is there a clickthrough workaround?


yulichka

Question

Based on this Q&A: Why don’t clickthroughs work in Wexley? – I learned that in order to use clickthroughs, you have to create a page and then use elements that feed from a gallery, such as the Gallery Grid Block.

To maintain the nice grid/layout styling of the Wexley template, I tried the Summary Block Wall layout instead, which created a great mosaic grid with clickthroughs included.

The problem now is – it only loads 30 pieces from a gallery at a time. Does anyone have any experience loading more than 30 or of another workaround that would make all of this possible? Could it possibly be done with some kind of code injection?

Thanks in advance for your help!

Edited by yulichka
Extra square bracket
Link to comment

Recommended Posts

  • 7

There is a way to do it using the default gallery. It requires doing an ajax load on the gallery json to get the clickthrough urls and then some DOM manipulation to change the thumb click event. Put the code below in your page header code injection for the page with your gallery:


<script>
 var currentPageBaseURL=window.location.href.split("?")[0];
 Y.on("domready",function(e){
   Y.io(currentPageBaseURL+"?page=1&format=json-pretty", {
       on:{success: jsonLoaded}
   });
   function jsonLoaded(err,data){
   try{
     var jsonResponse = Y.JSON.parse(data.responseText);
     var items=jsonResponse.items
     Y.all("#thumbList .thumb, #galleryWrapper .slide").each(function(e){
       var thumbId=this.getAttribute("data-slide-id");
       for(var i=0;i<items.length;i++){
         if(thumbId==items[i].id && items[i].clickthroughUrl){
           this.setAttribute("data-clickthrough-url",items[i].clickthroughUrl).on("click",function(e){
             e.preventDefault();
             e.stopPropagation();
             window.open(this.getAttribute("data-clickthrough-url"),'_blank');
           })
         }
       }
     })
     }catch(e){}
   }
 });
</script>

EDIT: updated it to work on mobile too.

Edited by ghostcat
Link to comment
  • 1

Hi Ghostcat,I entered your code above and seems to work but opens the linked page in a new window. Is there a way to change the code to so that it transitions in the same window? This would solve the issue for me completely. Cheers

Link to comment
  • 0

I also had a problem with Wexley's inability to use click-throughs. Another thread recommended using the Gallery Grid Block to replace the Wexley gallery on the homepage. When I did this, the click-throughs worked, but unfortunately, the new gallery images didn't flexibly realign the way the Wexley homepage did and I wanted to keep that effect. I don't have any experience with coding, so I was reluctant to make the changes in the above post.

I ended up hiring a programmer endorsed by Squarespace to make the tweaks for me. His name is Brad Good and he made the changes in half an hour tops. It was cheap too.

Now the click-throughs work perfectly with the Wexley homepage template. If you're in my position, I highly recommend seeking out his help!

Here's his info: http://specialists.squarespace.com/specialist/brad-good

Edited by danastasion
Link to comment
  • 0

Thank you! Do I only have to change the "currentPageURL"?My gallery page's url-slug is /product. So would the code look like this: var /product=window.location.href.split("?")[0]; ?

Is there anything else that needs to change? Thanks!!

Link to comment
  • 0

i have contacted the same specialist! hoping he will be able to help me out too :) do you think i could see your website to see how the clickthrough urls work? thanks!

Link to comment
  • 0

hi @ghostcat -- thank you for the script! I am in a similar situation as a few others here, where your script works beautifully, but only for the first image in the gallery. any idea why this might be, or if there is a quick fix to this problem? or did someone else figure out how to do this? I'd appreciate any help. thanks!

Link to comment
  • 0

Thank you for this bit of code!! I wish I had found it sooner - it's now saving me so much time and building pages and adding individual images with click throughs!

For everyone else - while it 'appears' not to be working, you need to clear your history, then it seems to work perfectly.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...