Site logo

[Resolved] URL link in Elements Dynamic Data not working as expected

Home Forums Support [Resolved] URL link in Elements Dynamic Data not working as expected

Home Forums Support URL link in Elements Dynamic Data not working as expected

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2591467
    Maria

    Don’t know what I’m missing. What I want to happen: When visitors click on “Get this typeface” link, they should be taken to the page to buy the font. Instead, they remain on the same page.

    Steps taken:
    Created Custom Post Type
    Created field in ACF using URL field type
    Created Block Element > Content Template
    Element > Display Rule set to the CPT
    Element Type > Content Template
    Enabled Dynamic Data
    Data Source > Current Post
    Link Source > Post Meta
    Post Meta Field > Fields Name

    Block Element.png
    Page: https://demo.mariajacksondesign.com/typeface/test-typeface/

    #2591918
    David
    Staff
    Customer Support

    Hi there,

    i see some extra HTML inside the headline:

    2023-04-01_14-09-07

    Where does that come from ?

    #2592237
    Maria

    It came from the Typefaces custom post type. I needed some dummy content to enter to test the page. https://www.screencast.com/t/c5E8AC3jx

    #2592416
    David
    Staff
    Customer Support

    Sorry I should have highlighted this:

    <a href="#">
        "Get this typeface
        <span class="new-tab-icon">«</span>
    </a>

    Where does that content come from ?

    #2592595
    Maria

    I added it to position the right upper arrow. I just removed it to help troubleshoot. https://www.screencast.com/t/AlgHR7lPL

    #2593000
    David
    Staff
    Customer Support

    OK, remove that HTML as it will break the string replacement.

    Just add the Headline block with some text, and a link, and then add the dynamic data.
    Does that work?

    Then we can look at adding icon.

    #2593665
    Maria

    I removed the HTML, added the headline block and added the dynamic data. It now works as expected, but how do I add the target=”_blank” attribute to open in a new window? I tried using the ACF field type Link, which gives the option to open in new window, but it doesn’t work. Not sure if this is a question for ACF.

    The field type URL now works, but doesn’t open in new window. The field type Link gives option to open in new window, but goes to 404 page. https://www.screencast.com/t/3jd6whG2y

    #2593786
    Fernando
    Customer Support
    #2593851
    Maria

    That works beautifully! Thanks to you both, David and Fernando.

    #2593907
    Fernando
    Customer Support

    You’re welcome, Maria!

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.