Skip Navigation

[Resolved] Link whole container block

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Minesh 3 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#1558485
Screenshot 2020-03-21 at 21.35.39.png

Hi, I need to link the whole container block (with background image and title inside it) and I found this: https://toolset.com/forums/topic/unable-to-insert-a-dynamic-link-in-the-block-editor-for-views/#post-1443831 but can't make it work.

This happens: I add the html blocks before and after the container block, but after saving they somehow turn corrupted, I get error "This block contains unexpected or invalid content." I resolve it converting back to HTML and same thing happens again after saving. In frontend the link is not created.

All this happens in Loop item's Block editor view.

#1559427

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As you may know, there is no such feature available to wrap the whole container block with the link. The workaround shared by Luo should work but the main thing I would suggest is to add a feature request to wrap the container block using the link:
=> https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

To see why the workaround shared by Luo is not working I need to check whats going on and how you wrap the container block. Can you please share access details with information that what block you want to wrap with the post link. Please share problem URL.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1561007

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

I've added the following JS code to your view's Loop Editor section JS box:

jQuery(document).ready(function(){
   
 jQuery(".col-sm-3").each(function(){
      val =  jQuery(this).find(".currenturl a").attr('href');
      attrval = "window.location.href='"+val+"'";
      jQuery(this).attr("onclick",attrval);
});
 
});

Also, I've added the class currenturl to your single field block that displays the post link and I can see now it works as expected. Can you please confirm it works at your end as well.

#1562293

Yes it's perfect, thank you Minesh!

#1879181

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

This feature is added to Toolset Blocks plugin. Please check the following Doc:
=> https://toolset.com/course-lesson/container-blocks/#turn-a-whole-container-into-a-link

*** Please make a FULL BACKUP of your database and website.***
Please make sure to update ALL Toolset plugins to it's latest officially released version. You can download the latest plugin release from your accounts page:
=> https://toolset.com/account/downloads/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.