How to add a HTML script element to all pages
How to add a HTML script element to all pages (Q2 SDK)
Hello,
I have an HTML <script> element that references an external JavaScript file that I want to add on every page (including home, transactions, services, or any other custom extension that I've added to nav which opens a new page, etc.). This <script> is responsible for setting up and managing the Zendesk customer support chat widget. For context this is what the script looks like:
`<script id="ze-snippet" src="https://static.zdassets.com ..."></script>`
I was able to add the <script> element to the *index.html.jinja2* of a custom extension of type *Online* and it worked. However I'd like to add it somewhere so that the chat widget is rendered on every page. Could someone tell me how I can do that or point me in the right direction?
I have looked at this documentation:
https://docs.q2developer.com/guides/frontend_development/uux_payload.html
However, it is my understanding that this would only allow me to add the JavaScript to custom extensions that I have created and not necessarily to pre-exisiting pages (i.e. home, transactions, services, branches, etc.)
Thanks,
Anan
Hello,
I have an HTML <script> element that references an external JavaScript file that I want to add on every page (including home, transactions, services, or any other custom extension that I've added to nav which opens a new page, etc.). This <script> is responsible for setting up and managing the Zendesk customer support chat widget. For context this is what the script looks like:
`<script id="ze-snippet" src="https://static.zdassets.com ..."></script>`
I was able to add the <script> element to the *index.html.jinja2* of a custom extension of type *Online* and it worked. However I'd like to add it somewhere so that the chat widget is rendered on every page. Could someone tell me how I can do that or point me in the right direction?
I have looked at this documentation:
https://docs.q2developer.com/guides/frontend_development/uux_payload.html
However, it is my understanding that this would only allow me to add the JavaScript to custom extensions that I have created and not necessarily to pre-exisiting pages (i.e. home, transactions, services, branches, etc.)
Thanks,
Anan
#jinja
#html
#script
#sdk
#chat
How to add a HTML script element to all pages (Q2 SDK)
Hello,
I have an HTML <script> element that references an external JavaScript file that I want to add on every page (including home, transactions, services, or any other custom extension that I've added to nav which opens a new page, etc.). This <script> is responsible for setting up and managing the Zendesk customer support chat widget. For context this is what the script looks like:
`<script id="ze-snippet" src="https://static.zdassets.com ..."></script>`
I was able to add the <script> element to the *index.html.jinja2* of a custom extension of type *Online* and it worked. However I'd like to add it somewhere so that the chat widget is rendered on every page. Could someone tell me how I can do that or point me in the right direction?
I have looked at this documentation:
https://docs.q2developer.com/guides/frontend_development/uux_payload.html
However, it is my understanding that this would only allow me to add the JavaScript to custom extensions that I have created and not necessarily to pre-exisiting pages (i.e. home, transactions, services, branches, etc.)
Thanks,
Anan