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.

exclude specific entry_id from search result

February 27, 2009 11:27am

Subscribe [3]
  • #1 / Feb 27, 2009 11:27am

    Lavi Yatziv

    28 posts

    Hello All!

    there must be an easier way of doing this but we are looking to have very specific results displayed and rather than go through all the weblog entries. would it be easier to just “selectively filter” these results here?

    I’m fairly certain that this will throw off the total number of results.

    What I’m wondering if there is a more elegant way of doing this…

    {exp:search:search_results}
    {if entry_id == '123' || entry_id == '456' || entry_id == '789'}
        {!-- do nothing --}
    {if:else}
    {!-- continue with page rendering search results --}
        <h6>{weblog}</h6>
    <p>    <div id="excerpt"><li>{excerpt}</a></li></div><br />
        <br />
    {/if}<br />
    {/exp:search:search_results}

  • #2 / Feb 28, 2009 3:40am

    Versa Studio

    572 posts

    What are the criteria to show/not show a given entry? Can you flag them somehow, and then do:

    {exp:search:search_results}
    {if flagged}
      do nothing
    {if:else}
      show results
    {/if}
    ............
  • #3 / Feb 28, 2009 6:21am

    Mark Bowen

    12637 posts

    Hi Lavi,

    I know that going through each of your weblog entries might be a bit of a pain but surely if you are having to find out their entry_id to do this sort of thing then you are already sort of going through them all anyway aren’t you?

    Would it not be possible to make use of a different status to only bring back entries with certain statuses and leave out the others? The search form allows for this.

    Don’t know if that helps at all.

    Best wishes,

    Mark

  • #4 / Mar 02, 2009 10:17am

    Lavi Yatziv

    28 posts

    I think it would be handy to enter the id’s into an array, maybe set up a table in the DB…

    What’s needed is to filter based on whether or not the entry appears in the pnm (pages nested menu)

    I have no clue how to add that filter to the search results... I imagine it would take some solid sql kung fu.

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

ExpressionEngine News!

#eecms, #events, #releases