0

I'm making a filter functionality where the user can do a keyword search and sort by "Newest", "Most viewed" and "Most pinned". I'm using Low Search to do the search, Solspace Tracker for counting views, and Solspace Favorites to let the user pin content.

My approach to get the results is to first do the search with Low Search (if the user did a keyword search) and stash away the resulting id's. Then insert the id's into the entry_id parameter. This works great when I use {exp:channel:entries} and {exp:tracker:rank}, but not with {exp:favorites:rank}. Here's a stripped down example of my code:

{exp:favorites:rank 
    entry_id="{exp:stash:get name='search_result_ids'}" 
    show_unfavorited="yes" 
    orderby="count" 
    channel="article" 
    limit="10" 
    pagination="bottom" 
    parse="inward"}

    entry_id = {entry_id}<br>

{/exp:favorites:rank}

Even if I harcode id's into the entry_id parameter, all entries are being returned. Is this a bug, or intended behavior? It says in the documentation that "Most of the parameters available in the Channel:Entries loop are available here", which really isn't much help. "Most of" could mean that entry_id isn't one of them, but who knows? :)

3
  • What version of Favorites are you using? What version of EE are you using? Have you tried using a single, hard-coded entry_id to see if non-multiple entry_ids work?
    – Solspace
    Oct 11 '13 at 17:22
  • I'm using EE 2.7.2 with Favorites 3.1.2. Yes, I've tried with a single, hardcoded entry_id - all entries are still returned. Or, the other params on the tag works as expected, so only entries in the article channel, limited to 10, etc. But setting entry_id="26" (which is a certain entry), doesn't matter.
    – aelvan
    Oct 12 '13 at 11:14
  • I spent the morning digging into the code, and concluded that entry_id isn't supported. I implemented a hack for it myself, it's documented here. Hopefully support for entry_id can be added in a future version?
    – aelvan
    Oct 12 '13 at 12:35
1

I just did a test with hard coded entry ids like this

entry_id="5172|5188" 

It returned the same results as omitting the entry id param. So i would say, yes the entry_id is not available as a param for rank.

Note:docs say this The Favorites:Rank loop shows and ranks channel entries by the amount of times they've been saved to Favorites by members.

And it looks like you want to rank (by favorites count) unfavorited entries!

This doesnt work either

{exp:favorites:entries entry_id="7702|5188" } {entry_id}{/exp:favorites:entries} 

Sorry, cant help you.

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.