Javascript mass add

Hello. I have pages with travel search javascript module
Javascript give different search results depending on parameters in Javascript.

I will to create many pages with same javascript, but different parameters in each page.
For this purpose i have template page in html text code, which html i edit in texteditor, and create new pages.
But the problem is, that javascript, inserting by Raw javascript method, cannot be edit (by find and replace parameters) in text mode.

How to insert javascript to page and have it for edit in text mode?

Thank you

Hi there @ermitag,

Thanks for writing in!

Depending on the exact code you need to use and over how many pages, it’d most likely be best to code a custom function that adds the code to the pages dynamically with variable parameters based on what’s required.

There’s no way out the box for the javascript itself to be editable in text mode, this would break both the editor and your code.

Thanks!

Hi there,

Unfortunately, there is no such a function or plugin as I know of. You have a very specific case which honestly is not related to our theme.

The only thing that our theme can be of a help is to add the pages via Cornerstone. Then inside there you will have a section called JS for that specific page which you can use to add your code:

Other than that our theme does not provide extra functionality regarding mass Javascript import.

Thank you for your understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.