헬프 센터에 자체 테마 자산 사용하기



image avatar

Jennifer Rowe

Zendesk Documentation Team

2025년 5월 01일에 편집됨


-4

0

댓글 33개

What is the maximum file size of assets? I have found that larger files do not upload successfully.

0


Gab I meant to use another JS file from assets in the script.js file within the theme. Currently, we do import via documenation_head.hbs.

0


Hi Rajan, 
 
That's definitely possible. You can import a zip archive of a help center theme, containing templates, JavaScript, CSS, and assets.
 
More information can be found here: Importing a help center theme
 

0


Tipene Hughes Gorka Cardona-Lauridsen I want to import the js file from assets in the script.js file. Is it possible??

0


No worries at all, and great call out! I'm working with our docs team now to have this clarified.

1


Hey Tipene Hughes

Thanks for the info. I had almost thought so. A suggestion would be to include this info in your help center articles. 

I think I will solve it by simply copying the CSS content into the style.css.

Thanks again for the great support. 

0


Thanks for the additional context, Gerrit!

I've just received confirmation that it is not possible to access image assets from within a CSS stylesheet that has also been uploaded as an asset. Currently, the asset path variable only resolves correctly within the themes default style.css file or in it's templates.

Edit: to add, if you did want to use the image asset directly in the HTML template, you would need to use the asset helper, which would look something like this:

<div style="background-image: url({{asset 'prev.png'}});"></div>

1


Hey Tipene Hughes
thanks for your reply.

I tried this (with and without ' ' ). 

<div style="background-image: url('$assets-prev-png');">&nbsp;</div>

did not work. A freshly uploaded image did not work either.

I can see this:

BUT! 

I added a class to my regular style.css file of the template

.prev-img{
background-image: url($assets-prev-png);
}

in the article I added just a <div class="prev-img"></div>

and this is the result and its shown in the article :

Does this mean, I cannot use it in a CSS File which I added in the asset folder?

0


Hey Gerrit,

Out of curiosity, can you try adding the background as an inline style in your HTML to see if that can access the asset correctly? Also, it might be worth removing the png from your help center assets file and re-adding it.

Let me know how you go!

1


David Bjorgen Thank you very much. Unfortunately this does not work either :(

I see 403 errors in the console.

Maybe I should contact tech-support. 

0


로그인하세요.