Custom Icons for Categories on Home Page | Community
Skip to main content

Custom Icons for Categories on Home Page

  • October 19, 2018
  • 2 replies
  • 0 views

We recently switched to the new theme editor, and I'm having trouble figuring out how to reference assets in my homepage. We have icons for each category:

The asset name is the same as the category (e.g. Reports.svg). These were all set up under the old theme editor. This is the code we have in our home_page.hbs:

{{#each categories}}
<li class="flex-item">
<a href="{{url}}"><img class="head-icons" src="//p4.zdassets.com/hc/theme_assets/243990/115000000703/{{name}}.svg">
<p>{{name}}</p>
<h2>{{description}} </h2>
</a>
</li>
{{/each}}

The problem happens when I try to create a new Category under the new theme editor. The URL has apparently changed, and the image does not render. Under the new editor, how would I dynamically assign the image to the category?

2 replies

Trapta
  • October 23, 2018

Hi @Tim,

Take a look at this tip: https://support.zendesk.com/hc/en-us/community/posts/115008316527-Adding-images-icons-into-the-Copenhagen-Theme

Let me know if this solves your issue.

Thanks

Team Diziana


  • Author
  • October 24, 2018

Thank you @Trapta! That is exactly what I needed!