Changing index.html and bundle.js

Is index.html and bundle.js is connecting to the web application part.I am changing some of the properties in both files but it is not reflecting on web app.Can you clear this doubt

Can we change Web application Interface Title and footer part.?

Hi! If you want to, you should be able to edit the page title in the index.html in your Prodigy installation. You can find the location by running prodigy stats and looking at static/index.html. When you restart the Prodigy server, your changes should be reflected.

The more elegant solution would probably be to use custom "javascript" in your prodigy.json and modify the page attributes this way. I wouldn't recommend editing the bundle.js, though, since that's all compiled JavaScript.

I'm asking about .prodigy-sidebar-title can i able to change with the custom name.?

It's not reflecting to the web part when i'm running custom recipe.

In that case, you can just use JavaScript via "javascript" in your config to modify the element, e.g. select it via document.querySelector('.prodigy-sidebar-title') and then change it depending on what you need to do.

DO i need to write html code separately for the javascript i wrote or just i need to connect with the index.html.Can you explain clearly with an example for changing the "prodigy" with the custom title.

If you actually want to edit the HTML elements, you can do this in JavaScript via the "javascript" in your prodigy.json or recipe config. How exactly you set this up depends on what you want to do, but you can do things like this for example:

const title = document.querySelector('.prodigy-title');
title.innerHTML = "<strong>Hello</strong>"

i tried this to change document title on browser but it keep changing back to 'prodigy'
inside a recipe

document.title = "Pecha Tools";

The Javascript that you're able to run can be overriden by our React code when it interferes with what it is trying to render. I can imagine that this is what's happening here. document.title feels like it's something that's protected.

does it mean i cannot change the title on the browser? or is there any other way to change it. do we have access to the react code itself ?

I'll ask to double-check, but the react code is presented through a static bundje.js that isn't editable. We are revisiting custom JS recipes in Prodigy v2, but it's not a focus for the current Prodigy v1.12 release.

1 Like