最近搜索


没有最近搜索

Show category first instead of homepage in the breadcrumb path in search results?

已回答


已于 2021年11月02日 发布

Does anyone know of an easy way to omit the homepage from being included in the search results breadcrumbs? Since the homepage is a given for a single help center, it seems rather silly that is in the breadcrumb path output . I would rather the category be the first in the path because our categories are our products. Any help would be appreciated. 

 


0

3

3 条评论

image avatar

Tipene Hughes

Zendesk Developer Advocacy

Hey Samantha,
 
Thanks for reaching out!
 
It sounds like the #isnt helper might be useful here. You could add that to your search_results.hbs file to exclude path_steps at a specific index. Here’s an example of how that could look:
 
<ol class="breadcrumbs search-result-breadcrumbs">
    {{#each path_steps}}
        {{#isnt @index 0}}
          <li title="{{name}}"><a href="{{url}}" target="{{target}}">{{name}}</a></li>
        {{/isnt}}
    {{/each}}
</ol>
 
Here’s a link that goes into a bit more detail on the #isnt helper:
 
https://developer.zendesk.com/documentation/help_center/help-center-templates/helpers/#isnt-helper
 
I hope this helps! Feel free to reach out with any questions.
 
Tipene

1


Ha! worked like a charm. I should have asked here before spending days trying to figure it out myself. You are a gem, thank you. 

0


image avatar

Tipene Hughes

Zendesk Developer Advocacy

Glad to hear that did the trick.
 
Have a great day!
 
Tipene
 
 

0


请先登录再写评论。

找不到所需的内容?

新建帖子