Ricerche recenti


Nessuna ricerca recente

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

Con risposta


Data ultimo post: 02 nov 2021

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 commenti

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


Accedi per aggiungere un commento.

Non hai trovato quello che cerchi?

Nuovo post