Using your own theme assets for Help Center (Guide Professional and Enterprise)

Have more questions? Submit a request

44 Comments

  • Nicole - Community Manager
    Comment actions Permalink

    Thanks for letting us know, Roxanna. Glad to hear you got things sorted!

    0
  • David Bjorgen
    Comment actions Permalink

    What file types are accepted as assets? It seems that PHP and HBS aren't supported.

    0
  • Jennifer Rowe
    Comment actions Permalink

    Hi David,

    Please see this section for the list of allowable assets:

    https://support.zendesk.com/hc/en-us/articles/115012399428#topic_u41_tdt_vhb

     

    0
  • Callum Walley
    Comment actions Permalink

    How would one update an asset using the API?
    Currently I am using a .json asset to generate page content and have to replace it manually every time I need to update the page, can this be automated or should I be using another method for making dynamic content?

    0
  • Devan
    Comment actions Permalink

    Hello Callum,

    What you described currently isn't available in Guide. I would recommend suggesting this update in our Product Feedback forum so our developers could consider implementing this feature into our base program. 

    Guide Product Feedback

    1
  • Gorka Cardona-Lauridsen
    Comment actions Permalink

    Hi Callum

    We are currently running an Theming API EAP, which may help you.

    While the theming API does not currently offer the ability to update an asset in a theme or an entire theme, your problem can maybe be solved by uploading an new theme via the API with the updated asset and then setting it live via the API.

    You can read more and sign up here.

    If you have questions regarding the Theming API you are welcome to post them in the Themin API EAP topic.

    Depending on your use case you may also be able to use the dynamic content API.

     

    1
  • Rakesh Sompura
    Comment actions Permalink

    Hello,

    I am building a custom theme and integrated my Github Repo. 

    Somehow, I am not able to see the updated assets added to my asset folder. Do you have an idea what could be the reason. It works fine on local preview but not working when I commit changes to repo and update the theme in Help Center.

    Can someone help?

    Thanks,
    Rakesh

    0
  • Brett - Community Manager
    Comment actions Permalink

    Hey Rakesh,

    Can you confirm you went through the following steps to update your Github-managed theme in Guide? Updating your Github-managed theme in Guide

    I believe you'll need to go through those steps provided before your assets are updated.

    Let me know!

    0
  • David Bjorgen
    Comment actions Permalink

    Is there a way to utilize the asset helper to insert a CSS background image inline in script.js?

    Example:

    <a href="#" target="_blank" style="background: url($assets-banner-png);"></a>

    Zendesk doesn't seem to recognize inline CSS assets.

    0
  • Rakesh Sompura
    Comment actions Permalink

    Hi David,


    I think you can do something like this, which works:

    <a href="#" target="_blank" style="background: url({{asset 'banner.png'}});"></a>

    It does work as I have used it in the theme I am working on.


    Thanks,
    Rakesh

    0
  • David Bjorgen
    Comment actions Permalink

    Rakesh,

    I could not get that to work. I tried a number of different variations but to no avail.

    0
  • Rakesh Sompura
    Comment actions Permalink

    Hi David,

    Strange, the above code works for me on my theme. I am extending the standard Copenhagen theme.

    Are you trying to access image on the template level or do you want it to use in JavaScript? It may be available in template but in JS it does not as the assets are being served via CDN and it renames the image name with encryption and hence the asset name does not stay the same.

    I had to also struggled to learn that... so if you are not trying to use the image with combination of some dynamic code and only need the image path in JS, let me know. I have one solution which may help to get you the name of the image in JS.

    Thanks,
    Rakesh

    0
  • David Bjorgen
    Comment actions Permalink

    Rakesh, I think the reason it's not working for me is that I'm trying to inject the asset in the script.js file. And as you said, since ZD renames the image in order to serve it from the CDN, I cannot access it directly. I've found a JS + CSS workaround, but it's a multistep process. I'd like to be able to insert the image path as a variable in my script.js file and let the code do the rest.

    0
  • Ryan McGrew
    Comment actions Permalink

    Hey David,

    Looking at the thread we'd recommend that you create a namespaced/global variable in the document_head.hbs template and then reference that in script.js. Something like the following

    document_head.hbs:

    <script>

      var linkBackgroundUrl = "{{asset 'link-background.jpg'}}";

    </script>

    then in script.js you should be able to reference the linkBackgroundUrl variable. Let me know if that makes sense. The concept can be expanded upon and can likely be made much more elegant than this simple example. 

    0

Please sign in to leave a comment.

Powered by Zendesk