logo

Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll
22/02/2025, by Anonymous (not verified)

Please be so kind as to help me make the product card a link.

 

In Views, I have displayed several fields. I excluded all fields except the last one from the output, and in the last one, I used tokens to display all fields. Now I need to wrap all these fields in a link that will lead to the material. However, the problem is that the product card has a form with a "Add to Cart" button. This means that this form cannot be inside the link, and therefore I cannot use the standard option "output as a link."

 

The code is approximately as follows: code

 

Here, the link is .link_to_node
and I wouldn't want to place the block .buy_area inside the link since it contains the form.

 

This is how the product card looks externally  

If you're interested, I tried to hide all fields and output 2 fields after them. In one, I displayed the fields that should be in the link, and in the other - the form with the "Add to Cart" button. Then I attempted to enable the "output as a link" option for the first field and specified the token [view_node] in the path. As a result, I got a path like this 

http://test1.ru/site_mstore/drupal7_mstore/view