Forum › General Inquiry
I went looking for some information on this. I found https://getpublii.com/dev/how-to-add-custom-config-or-js-for-post-editor/ but I wasn’t sure if that was applicable to what I want to do.
Am I missing the correct documentation? If someone can point me in the right direction I’ll take a pop at figuring it out myself.
Just use the Custom HTML tool → https://getpublii.com/docs/tools.html#customhtml
Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!
I’m sorry, I’m not sure that applies to what I’m doing. I want to put different scripts on different posts. This looks like it’s for HTML sitewide?
You must think I’m quite stupid, I apologize.
I’m afraid, by default there is no way to put different scripts on different post pages.
Custom HTML tool places your script/s in dedicated rooms like header, footer, body …
You will have to play around with the post config option to create a dedicated “room” for your scripts and then you will be able to paste different codes into different posts.
More about it: https://getpublii.com/dev/post-config-options/#post-config-options
Thank you. Would the simplest thing be to put all my scripts in one js file and apply that globally using the Custom HTML tool? They’re already set up as functions.
Upload your e.g. script_name.js using File Manager, then use the Custom HTML tool (move it to the footer) to add this file as follows: