Project

General

Profile

Search Box Custom Fields

Added by Buddy Clarkson over 2 years ago

Hello,

I'm trying to show in my search results that custom fields are showing.

Custom fields don't have to be searchable.

We have assigned a number to all tickets that we want to show when searching.

If found in \app\views\search\index.html.erb

<% if @results >
<div id="search-results-counts">
<
= render_results_by_type(@result_count_by_type) unless @scope.size == 1 >
</div>
<h3><
= l(:label_result_plural) > (<= @result_count >)</h3>
<dl id="search-results">
<
@results.each do |e| >
<dt class="<
= e.event_type > icon icon-<= e.event_type >">
<
= content_tag('span', e.project, :class => 'project') unless Herve Harster == e.project >
<
= link_to(highlight_tokens(e.event_title.truncate(255), @tokens), e.event_url) >
</dt>
<dd><span class="description"><
= highlight_tokens(e.event_description, @tokens) ></span>
<span class="Aktenzeichen"><
= highlight_tokens(e.CustomField.find(1).enumerations.each_with_index) ></span></dd>
<
end >
</dl>
<
end %>

But its dont work :-(

Thanks very much!