- This topic has 26 replies, 3 voices, and was last updated 6 months ago by
Jean Paiva.
-
AuthorPosts
-
September 26, 2022 at 10:14 pm #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
September 26, 2022 at 10:50 pm #2354784Fernando Customer Support
Hi Matt,
Can you try using a GB Button to test first?
September 26, 2022 at 11:01 pm #2354792Matt
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.
September 26, 2022 at 11:05 pm #2354797Fernando 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.
September 26, 2022 at 11:10 pm #2354799Matt
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
September 26, 2022 at 11:15 pm #2354801Fernando Customer Support
Can you share temporary login credentials?
Please use the Private Information field for this.
September 26, 2022 at 11:21 pm #2354808Matt
Please see below
September 26, 2022 at 11:36 pm #2354822Fernando Customer Support
Can you make the user an Administrator? We’ll check if we find anything which may cause the issue.
September 26, 2022 at 11:36 pm #2354823Matt
Done
September 26, 2022 at 11:43 pm #2354825Fernando 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.
September 26, 2022 at 11:53 pm #2354830Matt
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.
September 27, 2022 at 12:14 am #2354845Fernando Customer Support
Can you try recreating the field with a slug name that has no underscore?
September 27, 2022 at 12:23 am #2354850Matt
Still getting the same result. Are you saying that you have tested elsewhere and get a different result?
September 27, 2022 at 12:38 am #2354880Fernando 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.September 27, 2022 at 12:50 am #2354893Matt
Please see the link below
-
AuthorPosts
- You must be logged in to reply to this topic.