[Resolved] Favorites button appearing multiple times in toolset blocks
This thread is resolved. Here is a description of the problem and solution.
Problem:
I am trying to resolve an issue where the 'Favorites' (Bookmark) button appears multiple times on the same page, instead of just once at the top as expected. The button seems to appear whenever a 'Single Field' dynamic data block is used.
Solution:
The issue occurs because the 'Favorites' plugin likely injects the Bookmark button via the "the_content" filter, which also affects WYSIWYG fields. To prevent this, insert the WYSIWYG fields via a shortcode with the suppress_filters='true' attribute to stop third-party filters from applying.
Usually, such problems happen when you have the wrong HTML code. For example, if you forgot to close a tag or something like that.
Please copy the page to have a working version to test and do as follows:
Remove some parts of the page and see if the problem occurs, do that to find the section that caused the problem and check the HTML code for that section.
I don't think that that is the issue. The places that the 'bookmark' button are showing are at the beginning of the page 'before content' (as set in the 'favorites' plugin setup) and then it appears at the beginning of a 'single field' block that is not my HTML but code pulled in by Toolset. I tried opting for the 'show after content' and the multiple version of the button showed at the end of said 'single field' blocks.
The strange thing is that it doesn't affect every instance of the 'single field' block on the page.
Thanks for continuing to help me.
I have just done a little more research and looked at the two 'single field' blocks that I am pulling in and they are both ones that are WYSYWYG custom fields ... and when nothing is entered into this field (at all) then no 'Bookmark' button shows on the front end but as soon as I enter info into one of the WYSYWYG custom fields then the 'Bookmark' button shows.
I hope this narrows down the search for a solution
I will need more context. What does the Favorite plugin do and how it adds the content? This seems to be a compatibility issue as it has another plugin included.
I'd appreciate it if you could give me the URL/User/Pass of your WordPress dashboard after you make sure that you have a backup of your website.
It is absolutely important that you give us a guarantee that you have a backup so if something happens you will have a point of restore.
Make sure you set the next reply as private.
What I need you to do is to create a new page and only use one single field and the button that you use and tell me how you added the bottom so I can check.
Just to be on the same page if there is a problem with compatibility we do not have a guarantee to fix.
I did respond to the email but now see that I should have logged in and responded here.
I am happy to set up a user for you but I need to know what email address I should apply to it, as this is a required field when setting up a user on my WordPress.
If you let me know then I will set this and the FTP up for you and yes I have taken a backup and downloaded it so I can restore the website should something happen
Sorry for bouncing your around supporters, but Christopher is off sick, so let me see if I can help.
Looking at the description of your problem, it seems to me that the plugin your are using probably injects the Bookmark button via the WordPress "the_content" filter, with the option to add the button before the post content.
WYSIWYG field content also gets passed through the same "the_content" filter, so the plugin would also inject the button before the content of those fields.
To prevent that it is necessary to prevent 3rd-party filters hooking into the_content.
There is no setting in the UI for this, you will instead have to insert the WYSIWYG fields via a shortcode and then add the suppress_filters attribute.
You could add a Shortcode block and then add the required shortcode directly to it, so from my test site with a field with a slug of "whizzer" that would be:
Or, use the Fields and Text block, where you can click the Toolset icon to generate and insert the shortcode, being sure to choose the option that prevents 3rd party filters (screenshot).
You guys are just so helpful and clear, that worked and I understand a little more each time you help me.
Thank you to both Christopher and Nigel for being supportive and most importantly solving my problem ... again ... if only the other organisations were as efficient and easy to work with.