[Resolved] Need to place widget javascript code in a field in the post editor & display FE
This support ticket is created 3 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I would like to be able to use some code available from a website: this generates a CQC rating and link to the ratings page.
This code would be unique to each post - and I would like to copy the post into the post editor - then pull this into a dynamic toolest block in the template so it generates the button and link
The widget is here:
each centre has its own unique code for the cqc rating
hidden link
The code looks like this ( the id changes for each centre )
At the moment I have an html block ( non toolset ) on the template with 1 of the codes pasted in so I can see what it looks like - but essentially I need to make that are dynamic, ideally with a toolset custom field on the back end of the toolset post editor - which then pulls the code into position on the page..
the result of the static code in the html block can be seen here
hidden link
That is the result I would like to achieve .. but with code entry dynamic on the back end editor
I couldn't get the code working using a dynamic Id within the code
I did resolve and find a workaround...
1) Created a new custom field ( text )
2) Place the whole of the code script in the field
3) Used a single field block in the template
4) Used the post source to pull in the correct field - which generated a short code and displays the widget