Is there any possibility to apply a Custom Client Script on a Workspace?
I know it can be applied to the Form view and the List view of the Workspace Doctype, but there is no possibility to apply it to the frontend, where the user views the workspace.
Also adding javascript into custom html blocks did not do the trick for me.
Would be really nice to have this possibility for customization.
AFAIK there is no way to achieve this with client script.
Create a custom app instead.
You will need to edit hooks.py file . It is located under your app folder (yourbench/apps/yourapp/hooks.py). Add a line like this:
app_include_js = "/assets/app_name/js/yourapp.js"
Create yourapp.js file in yourapp/public/js folder.
In this file, write:
$(document).on("startup", function () {
if (location.pathname.endsWith("/selling") {
console.log("I am here! Where are you?"
}
;
});
Please, note that /selling is an example yourbench is the name of your bench folder on your server yourapp should be a custom app to preserve your customization in future updates.