I would like to make the entire element clickable

Solved

I would like to make the entire element clickable

SantosBaez
Excursionist
22 0 9

Hello!

 

I'm using PageFly for my landing page and would like to make an entire element clickable. I have three product cards that only the text is clickable. How can I make the entire element/card clickable?

 

Screenshot 2024-09-13 112636.png

 

The page URL is coffeeinboxes.com

 

Any help is appreciated, thanks!  

Accepted Solution (1)

namphan
Shopify Partner
1337 164 199

This is an accepted solution.

Hi @SantosBaez,

Please go to Actions > Edit code > Assets > base.css file and paste this at the bottom of the file:

h3.sc-jlGhtx.sc-fscnvs.eUrsGH.hLuCZM.pf-27_.pf-heading-1-h3:after {
    content: '';
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 1;
}
Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com

View solution in original post

Replies 8 (8)

namphan
Shopify Partner
1337 164 199

This is an accepted solution.

Hi @SantosBaez,

Please go to Actions > Edit code > Assets > base.css file and paste this at the bottom of the file:

h3.sc-jlGhtx.sc-fscnvs.eUrsGH.hLuCZM.pf-27_.pf-heading-1-h3:after {
    content: '';
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 1;
}
Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
SantosBaez
Excursionist
22 0 9

Awesome, thanks so much!

Can we do this for mobile as well? I duplicated the element for mobile (only visible on mobile) because I need to make some edit designs specific to mobile.

 

The one we edited is only visible on desktop.

 

Thanks!

namphan
Shopify Partner
1337 164 199

Hi @SantosBaez,

Please add code:

@media (max-width: 767.5px) {
    h3.sc-jlGhtx.sc-fscnvs.eUrsGH.hLuCZM.pf-399_.pf-heading-1-h3:after {
    content: "";
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 1;
}
}
Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
SantosBaez
Excursionist
22 0 9

Awesome, this worked! Thanks again!!

SantosBaez
Excursionist
22 0 9

Hello! I'm made some slight changes in PageFly and the code stopped working on both desktop and mobile view. Did the class name change with the edits I made? If you don't mind looking into it I would greatly appreciate it!

I also made a copy of the element in a separate page (for both desktop and mobile) . Could we also make the entire card clickable? The URL is https://coffeeinboxes.com/pages/coffee-boxes

 

Thanks so much!

BSSCommerce-B2B
Shopify Partner
1790 548 608

@SantosBaez ,

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above </head> tag:

<style>
.pf-slide h3[data-product-type="title"]:after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0!important;
}
<style>

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

PaulNewton
Shopify Partner
7279 641 1512

You either need to actually modify the template to have an anchor tag, it's html or use some CSS kludge to position it absolutely:

[data-pf-type="Column"] h3[data-product-type="title"] {
  line-height: 758px;
  position: absolute;
  top: 2px;
  bottom: -18px;
  left: 0;
  right: 0;
  align-self: end;
}

The problem is making the clickable text element cover the card makes the actual text go to the head of the card.

So you have to push it down using line-height.

Of course the real problem is the product cards use an H3 heading element as a fake link instead of using an actual anchor tag.

 

 

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


PaulNewton
Shopify Partner
7279 641 1512

If possible because this a theme integration and-or you can't edit the css in pagefly directly...

, try to use a custom css setting instead of having to directly edit theme code limiting the change of breaking files.

https://help.shopify.com/en/manual/online-store/themes/theme-structure/extend/add-css

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org