[Support request] ACF File Field as Content Template Dynamic Link

Home Forums Support [Support request] ACF File Field as Content Template Dynamic Link

Home Forums Support ACF File Field as Content Template Dynamic Link

Viewing 15 posts - 1 through 15 (of 27 total)
  • Author
    Posts
  • #2354764
    Matt

    Hi Guys,

    Just wondering if the following is possible as I’m getting some issues.

    I have an ACF ‘file’ type field setup with return type ‘url’ (string) setup on my blog posts. As the blog articles have no text or images, (just a title and file upload), I want to allow a user to browse to the main blog archive page, click on a post, and be able to view/download the file that was uploaded without having to go to the post-single page.

    I have set up a content template for the post archive layout, and am setting the dynamic link to ‘post_meta’ on the outer container and then adding my acf field name (‘file_download’) as the ‘meta_field_name’. When I view on the front end the lin is added, but not directed at the url of the uploaded file (eg. http://0.0.6.136/)

    Am I doing something wrong here, or is this not the intended use for the dynamic link field on a content template container?

    Thanks

    #2354784
    Fernando
    Customer Support

    Hi Matt,

    Can you try using a GB Button to test first?

    #2354792
    Matt

    I get the same result with a button. ie. the same incorrect link is returned.

    When I use the acf shortcode in a shortcode field it does return the url to the file. So I do know that the field is setup correctly and returning the right format.

    #2354797
    Fernando
    Customer Support

    That’s odd. That should work. I also tested from my end to be sure.

    Can you try recreating the field? Can you try just manually retrieving it through the ACF shortcode through a different Block Element for instance to test. If the issue occurs there as well, it would be best to reach out to ACF.

    #2354799
    Matt

    Sorry can I just clarify. I added a shortcode block to my content template and was able to output the url to the screen.

    I have added a link below for your reference. You can see the output of the shortcode above some of the articles, and if you hover over the article you can see the link that is being added to the container.

    What are you suggesting I do from here?

    Thanks

    #2354801
    Fernando
    Customer Support

    Can you share temporary login credentials?

    Please use the Private Information field for this.

    #2354808
    Matt

    Please see below

    #2354822
    Fernando
    Customer Support

    Can you make the user an Administrator? We’ll check if we find anything which may cause the issue.

    #2354823
    Matt

    Done

    #2354825
    Fernando
    Customer Support

    Can you try adding it in the Dynamic Data in the Block settings instead?

    Don’t forget to remove the Dynamic Link currently set in the toolbar.

    #2354830
    Matt

    I have editied the Element per your suggestion but an still seing the same. Below is a link to the one I have just edited.

    #2354845
    Fernando
    Customer Support

    Can you try recreating the field with a slug name that has no underscore?

    #2354850
    Matt

    Still getting the same result. Are you saying that you have tested elsewhere and get a different result?

    #2354880
    Fernando
    Customer Support

    Yes, I tested from my end, and an ACF file type – URL is working as a dynamic link. It’s weird cause the code in GP/GB only uses get_post_meta(), and it shouldn’t cause such an issue.

    Can you create a Hook Element, hooked somewhere in your single post pages, and set it to:

    <?php
    
    var_dump(get_post_meta(get_the_ID(), 'YOUR-META-SLUG', false) );
    
    ?>

    Make sure Execute PHP is enabled.

    #2354893
    Matt

    Please see the link below

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