Announcement

Collapse
No announcement yet.

Why Does This Link Not Work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • greggc
    replied
    Originally posted by SidFeyDesigns View Post
    greggc I would reccomend not using the button tag at all and style the anchor (a) tag with css to look like a button.

    The button tag nested inside the anchor tag is not valid html.

    You can do it using a class or inline style like you currently have it.

    HTML:
    Code:
    <a href="/Label-PDF/sandpurge.pdf" target="_blank" style="background-color:#3300ff;color:white;font:14pt Arial, Helvetica, sans-serif, bold;-webkit-appearance: button;-moz-appearance: button;appearance: button;letter-spacing: 0.05em;padding: 1px 6px;border: 2px solid black;">View Label Info</a>
    
    OR
    
    <a href="/Label-PDF/sandpurge.pdf" target="_blank" class="view-label-button">View Label Info</a>
    CSS:
    Code:
    .view-label-button {
    background-color: #3300ff;
    color: white;
    font: 14pt Arial, Helvetica, sans-serif, bold;
    -webkit-appearance: button;
    -moz-appearance: button;
    appearance: button;
    letter-spacing: 0.05em;
    padding: 1px 6px;
    border: 2px solid black;
    }
    The CSS is based off your site's button CSS styling.
    Thank you. The css option was the way to go.

    Leave a comment:


  • SidFeyDesigns
    replied
    greggc I would reccomend not using the button tag at all and style the anchor (a) tag with css to look like a button.

    The button tag nested inside the anchor tag is not valid html.

    You can do it using a class or inline style like you currently have it.

    HTML:
    Code:
    <a href="/Label-PDF/sandpurge.pdf" target="_blank" style="background-color:#3300ff;color:white;font:14pt Arial, Helvetica, sans-serif, bold;-webkit-appearance: button;-moz-appearance: button;appearance: button;letter-spacing: 0.05em;padding: 1px 6px;border: 2px solid black;">View Label Info</a>
    
    OR
    
    <a href="/Label-PDF/sandpurge.pdf" target="_blank" class="view-label-button">View Label Info</a>
    CSS:
    Code:
    .view-label-button {
        background-color: #3300ff;
        color: white;
        font: 14pt Arial, Helvetica, sans-serif, bold;
        -webkit-appearance: button;
        -moz-appearance: button;
        appearance: button;
        letter-spacing: 0.05em;
        padding: 1px 6px;
        border: 2px solid black;
    }
    The CSS is based off your site's button CSS styling.
    Last edited by SidFeyDesigns; 11-03-22, 01:14 PM.

    Leave a comment:


  • greggc
    replied
    Changed the syntax on the button to <a href="/Label-PDF/sandpurge.pdf" target="_blank"><button type="button" style="font: bold 14px Arial;">View Label Info </button></a> All is fine now.

    Leave a comment:


  • afterdark
    replied
    Greggc:
    Good talk. Basically there is some logic on that custom field that says "if the field contains youtube.." to make this field a button and pop open a modal, "if the field contains X..." to make it a button. Otherwise, it is creating a text link and INCLUDING the link within the ADD to cart form. This could be edited in the USER INTERFACE --> PROD template but you should have developer look at it. Good luck.

    Leave a comment:


  • afterdark
    replied
    Hey Greggc:

    The link is within the FORM action - when selecting the PDF link, it adds the product to the cart. The custom field needs to be outside of this form.

    Do you know code? you would need to change the link to:

    Untitled 9.jpg

    OR you can make me an admin and I can do this for you call to discuss now if you like (619)702-7377 - James

    Leave a comment:


  • greggc
    replied
    Originally posted by afterdark View Post
    Hey Greggc:
    What is the url?
    https://www.horseandkennel.com/first...sandpurge.html

    Leave a comment:


  • afterdark
    replied
    Hey Greggc:
    What is the url?

    Leave a comment:


  • greggc
    started a topic Why Does This Link Not Work

    Why Does This Link Not Work

    When the below is added to a custom product field (a link to a pdf file) when the cursor hovers over the button it indicates that it is pointing to the pdf file. However, when clicked it adds the product to the basket. Any help would be appreciated.

    <a href="/Label-PDF/sandpurge.pdf" target="_blank"><button class="c-button u-bg-blue u-color-white u-text-bold u-text-uppercase" "type="button">View Label Info</button> </a>
Working...
X