Problem/Motivation

  • When using the USP item link field, the usp item should be fully clickable, now it isn't.
  • When filling in the USP item buttons, the USP item is fully clickable to the link of the USP item button. When using multiple USP item buttons, the USP item is fully clickable to the link of the last USP item button

Steps to reproduce

Fill in usp item link & usp buttons for a USP item.

Proposed resolution

I've checked the js in rocketship_paragraphs (p_007.js) for this, and found some issues:

linkTitle function

  • In the p_007.js file, there is a linkTitle function, which should link the title to the USP item link if filled in. However, this function is not used anywhere. Is there a reason for this?
  • When trying to use the function, it isn't working correctly, as it targets ".field--name-image-url-field a". Default, we're not rendering that field, as we use the display field for that. So the selector should be ".field--name-field-p-007-child-display-field a".

cardLink function

  • The main selector is the child button, but in my opinion the complete USP item should never link to the USP item button link? As the button is always visible and clickable when filled in.
  • The fallback selector is the image url (which is the USP item link). This should be the main selector and there should not be a fallback selector (see above).
    • The image url selector also uses the wrong url, as it targets ".field--name-image-url-field a, .field--name-field-p-media-image a". Default, we're not rendering those fields, as we use the display field for that. So the selector should be ".field--name-field-p-007-child-display-field a".

In my opinion, the desired/correct behavior should be:

  • USP item is only fully clickable when the USP item link field is used
  • When using USP item buttons, only the buttons should be clickable
  • When using both USP item link & buttons, the USP item should be fully clickable to the USP item link. The buttons themselve are clickable to the button links.

Comments

rubendello created an issue. See original summary.

  • rembrandx committed 6023a24 on 5.x
    Issue #3191068: Weird/wrong behavior on USP item links
    
rembrandx’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.