I have an issue with the Button block inside a View Loop. The button should have a dynamic button text, pulled from a field of another post. The button also has a dynamic button URL and it opens in a new window. The button works fine without the dynamic button text. With the dynamic button text, it does not render.
You'll find the working and non-working Button settings attached.
Yes, I see. But you've selected the current post title as the dynamic text. What I need though, is the text from:
Post source: other post
Post: "Website settings"
Field: "Msg: read more"
(see my screenshot for the result in the editor after selecting all of the above)
I have configured that multiple times but the button won't render. Since you did not see anything selected, that might be the problem: if selecting another post, the settings do not get saved.
I just configured it again and the button is gone again, from the frontend.
For the button dynamic text, I don't want to pull data from the Promotions post type. I set Post Source to "Other post" and then selected the post called "Website settings" and the field called "Msg: read more". I do this in many other views too and it works fine. This is the first time I do this in a button and then it fails.
In fact, I just added a Single Field block to the same View Loop, selected the desired fields, and that works fine too. It now displays the text "Read more now" in the frontend. Please check it out.
It's only the button which is failing. It does not render. I think it fails to store the settings somehow if I pull data from "Other post" instead of the posts we're looping through.
It would appear that on the backend it is pulling the data fine but on the frontend that data isn't being rendered.
Would it be possible to temporarily disable all the non-toolset plugins and check again to see if the problem here is being caused by a plugin conflict?
I managed to reproduce the problem on the staging site with no other plugins than Toolset and the 2022 theme. The page is hidden link. It should have a button below the image but it's not there.
I think this is needed to reproduce it:
A view inside a template, and the template is used in a page. With a view in a page there was no problem, it needs to be a template.
A button in the view loop with a dynamic text pulled from a custom field in another custom post.
Please try to reproduce it, or I can give you access to the staging site again.
I did a quick test for this on a sandbox site to see if it can be replicated on a fresh install.
I wasn't able to replicate it, however can you view and let me know if the setup is exactly or similar to the one i've setup.
Here is the sandbox site. hidden link
Secondly here is the page that i've setup the example hidden link
Thanks Shane. Your test is directly inside a post. What you need is a view inside a Content Template, and then use that template in a page (a post may work as well).
When I open the template it looks like no source has been selected for the dynamic text (see attachment). Not sure what that's about but if you did select a source, the setting was lost somehow (and that might be similar to the issue I have!).
If this does not help, do you allow me to setup an example in your sandbox site, or tweak the one you have?
Yes you can go ahead and setup the example on the sandbox site since this is something that we can share with our 2nd tier if you're able to replicate.
Please let me know once you've replicated the issue on the sandbox site.
I reproduced it. I changed two things: I used a custom post type (Cars) to output in the view, instead of a standard post. And I created another custom post type with a Single Line field to pull the dynamic button text from. The button does not render: hidden link. I have used this same approach in other blocks where it works perfectly. So it looks like a bug in the Button block.