Skip Navigation

[Resolved] Insert custom js in content template

This support ticket is created 4 years, 12 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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by jonasR-2 4 years, 12 months ago.

Assisted by: Nigel.

Author
Posts
#1400523

I am trying to build a site using the new Gutenberg based workflow and beta versions of modules

In this thread you mention, that inserting js code in content templates is possible:
https://toolset.com/forums/topic/adding-jqueary-to-content-template-doesnt-work-but-does-when-i-install-on-theme/

I cannot find this option in the new version - and the "custom css/js" option in toolset menu is not there either.
Is there a solution on how to add js to a content template without hacking around too much?

#1400693

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

When editing templates with Blocks there is a custom CSS editor in the side panel, but support hasn't been added for a custom JS panel.

I've created a request for the developers for this to be supported because I don't see an existing ticket.

In the meantime it should be reasonably straightforward.

Such a custom JS editor would simply print your code into the markup inside script tags, and you can do the same by inserting a custom HTML block into the template, adding opening and closing script tags, the writing your custom JS between those.

#1400697

Hi Nigel, thanks for reply - would be nice if you added this feature - and thanks for workaround instructions.