Adding JS code on specific pages - Forum | JoomShaper
Solved Helix Framework

Adding JS code on specific pages

Asked by pulsar agency 5 years ago Last activity 2 years ago

Hi
With helix Ultimate with or without SP Page Builder how can I add csutom JS code in the head or body sections for some specific pages only please ?

thanks

Cyril

Accepted answer

Marked as the solution
Paul Frankowski Senior Staff

Hi,

  1. using SPPB - not possible - Raw HTML addon - support only HTML code (!)
  2. Using Helix Ultimate - possible but you have to create template copies (Template Style) add your code and assign to selected menu items.

Alternative way would be to find a custom code plugin or custom code module (not Joomla core one!) and use them.

6 more replies

Paul Frankowski Senior Staff

If we talk about custom code module -- I recommend for example: HD-AnyCode

I mentioned about this also inside SPPB documenation.


You can use also Phoca Site plugin and hire developer to make a small customization inside it that allows you to use custom code on selected menu items only.

pulsar agency Asked this

HI

thanks Paul

With HD Anycode I'm not sure we can tell a JS code should be in the HEAD or BODY section

Cyril

pulsar agency Asked this

Ok Paul, making a new style and assign it to specific pages was the easiest way at the end of the day.
In the new copied style I could add the custom code in the head and body sections with the built in template features

thanks a lot

Paul Frankowski Senior Staff
5 years ago · edited

yes, 2nd method is very common (and good) - if you need this code on specific subpages only and you don't make template layout (or other) changes too often to forget about them in both theme styles.

You're welcome.
Have a nice day.

Pavel

To add JS to before </ body>, the standard HTML module + JCE editor can be used, in the Debug position on the required pages.

blue_Shift

If only advanced module manager didn't make a complete dog's breakfast of selecting a menu item - my client cannot make heads or tails of it.

Log in to reply.