Hiding author in search results based on theme settings? | Community
Skip to main content

Hiding author in search results based on theme settings?

  • March 7, 2025
  • 3 replies
  • 0 views

I am trying to figure out how to hide the author in search results.  This article suggests simply commenting out the author's name in search_results.hbs, which of course I can do. But I want the behavior to be controlled by theme's settings (i.e., settings.show_article_author). But when I wrap the HTML in search_results.hbs with the appropriate conditional:

{{#if settings.show_article_author}}
<span class="meta-data">{{author.name}}</span>
{{/if}}

I get an error message trying to save:

not possible to access `settings` in `settings.show_article_author`

I feel like I'm missing something obvious.

 

3 replies

Vishnuh
  • March 8, 2025

Hi 

 

Please update your code with the one below:

 

{{#if ../settings.show_article_author}}  
<span class="meta-data">{{author.name}}</span>  
{{/if}}

This will fix the issue you’re facing.
 

Thanks 

Group Vishnuh




 


  • Author
  • March 11, 2025

Perfect. Thank you.


Vishnuh
  • March 12, 2025

Happy to help :)