ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Using both "search" and "site" parameters on channel:entries?

October 13, 2011 5:36pm

Subscribe [2]
  • #1 / Oct 13, 2011 5:36pm

    Derek Hogue

    317 posts

    Not sure if this is a bug, or by design, or something particular to my setup.  On an MSM install, I have a channel:entries tag which uses the “search” parameter, and it works as expected - my entries whose specified field matches the search keywords are returned.

    Now if I take that exact, identical tag, place it in a template on another site in the MSM install, and add site=“site1”, the search parameter is entirely ignored - as in, the condition is absent from the MySQL query (site1 shows ” AND ( wd.field_id_93 LIKE “%y%” ) “, whereas site2 does not). As a result, I get all of the entries from that channel returned.

    Is this reproducible for anybody? This is under EE 2.2.1.

  • #2 / Oct 14, 2011 9:29am

    Sue Crocker

    26054 posts

    Hi, Derek.

    As it stands now, EE 2.x won’t allow you to to search multiple sites. Supposedly Solspace’s SuperSearch will. I haven’t used it yet, just read a thread about it.

    Does that help?

  • #3 / Oct 14, 2011 9:33am

    Derek Hogue

    317 posts

    Hey Sue - I’m not trying to search multiple sites ... I’m just trying to use the “search” tag parameter on a channel:entries tag which specifies a site other than the site the current template belongs to.

    {exp:channel:entries channel="staff" site="site2" search:my_checkbox_field="y"}

    Is that what you’re saying - that by design, the “site” and “search” parameters are mutually exclusive on the channel:entries tag?

  • #4 / Oct 14, 2011 1:17pm

    Lisa Wess

    20502 posts

    Hi, Derek,

    Those two parameters won’t play well together; search: only works on the current site.

  • #5 / Oct 14, 2011 1:20pm

    Derek Hogue

    317 posts

    Thanks Lisa. Is there a logic behind this, or should I file a bug report? Adding the “site” parameter only adds one extra database query, so I can’t see it being for performance reasons.

  • #6 / Oct 14, 2011 1:24pm

    Lisa Wess

    20502 posts

    It is not a bug - you can read about some of the intricacies in this archived feature request.

  • #7 / Oct 14, 2011 1:27pm

    Derek Hogue

    317 posts

    Thanks Lisa, that clears things up. Will instead use a category for now.

  • #8 / Oct 14, 2011 1:28pm

    Lisa Wess

    20502 posts

    Just so you are aware, categories are also site specific (since they end up being referenced by ID).

  • #9 / Oct 14, 2011 1:51pm

    Derek Hogue

    317 posts

    Isn’t the fact that categories have to be referenced by ID mean that the “category” parameter should play well with the “site” parameter? Since category_id is unique across all sites?

  • #10 / Oct 14, 2011 2:10pm

    Lisa Wess

    20502 posts

    Yes Derek - but in reverse; if you want to cross-share content across Sites by category, you’ll find that problematic.  Sorry for being unclear there.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases