0

We have build a site where members publish images in entrees which are tagged ( one or more tags). By using Profile:edit there also exists a channel with Member_data like name and adress. The author_id of entries in Images is therefore the same as one entry in Member_data.

My client wants to be able to search for tags, see in the result a collection of images and (in a sidebar) a list of all the authors as links to their own Profile Template.

My problem is that the authorlist show authors more than once ( if more than one image-entry of that author has been found).

I must therefore create, per search result, a dynamic index of authors, and I do not know how.

Is there someone that has done this before? Is this someting for the query module, or is there an addon?

Thanks for pointing me in the right direction.

0

Low Search will always return channel entries, whether that be News articles or Member data (which is a channel in your case).

For your search results, you basically want two lists:

  1. Unique entries from the channel "Images";
  2. Unique entries from the channel "Member_data".

The tricky thing is that #2 is related to #1 in the sense that you should only show entries from the Member_data channel that share an author_id with the entries from Images.

This is not something Low Search can do out of the box. You'd need some custom filters/extensions in order to make it work. You can contact me for a quote.

| improve this answer | |
  • Hi, and thank you for your time to answer this. If I explained my question not clear enough, I do apologize, sometimes it is not so simple to put words on it. I made it work with STASH, set list (of the search results) and get list with 'uniqueä for the author ID. I show the code in my answer. – Hansl Jan 18 '16 at 10:45
0

I made it work with Stash, set list, end get list with the tag 'unique' to filter author_id.

Getting the data (=search result):

I only want author, and (for the url) channel of the entry, author_id and entry_id.

 {exp:stash:set_list name="my_list" parse_tags="yes" parse_depth="2"}
{exp:low_search:results
  query="{segment_2}"
  status="not closed"
  disable="member_data|category_fields"
  require_all="category"
}
 {stash:item_title}{author}{/stash:item_title}
 {stash:item_artist_id}{author_id}{/stash:item_artist_id}
 {stash:item_id}{entry_id}{/stash:item_id}
 {stash:item_channel}{channel_name}{/stash:item_channel}
{/exp:low_search:results}
 {/exp:stash:set_list}

then printing the data, filtered by author_id (which I want to be unique)

<ul class="li_LinkRColumn">
{exp:stash:get_list name="my_list" unique="item_artist_id"}
    <li><a href="{path='Kcvast/konstnar/{item_artist_id}/{item_channel}/{item_id}'}">{item_title}</a></li>
{/exp:stash:get_list}
    </ul>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.