Using variables from the main site in custom theme templates for Guide | Community
Skip to main content

Using variables from the main site in custom theme templates for Guide

  • October 19, 2022
  • 1 reply
  • 0 views

Vladimir13

I have a main site for learning programming languages. There are 10 of them. I want to be able to pass a variable (the context of the current language being taught) when I go to the Help Center page, for example as a parameter in the url string, in order to display the articles in Guide according to this context. Can I use a custom variable in the theme templates in this way when customizing the theme? And in general, is there any way to use variables from the main site in custom theme templates?

1 reply

Tipene
  • October 28, 2022
Hey Vladimir,
 
One way you could go about this is by adding a search parameter to the href of your anchor tags on your main site i.e https://subdomain.zendesk.com/hc/en-us?language=javascript. Then, you could access the search param value via the window.location.href object from your help center and make your changes accordingly.
 
I hope this helps! Let me know if you have any questions.
 
Tipene