We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Bug: Limiting channel entries by search on url_title or title always returns one entry even when not matching

Development and Programming

dmDev08's avatar
dmDev08
100 posts
8 years ago
dmDev08's avatar dmDev08

Using EE 3.5.3:

The following two queries BOTH return an entry (and not one that matches):

{exp:channel:entries channel="pages" search:url_title="thisisfakeanddoesnotexist" limit="1" dynamic="no"}
{title}
{/exp:channel:entries}
{exp:channel:entries channel="pages" search:url_title="not thisisfakeanddoesnotexist" limit="1" dynamic="no"}
{title}
{/exp:channel:entries}
       
JT Thompson's avatar
JT Thompson
745 posts
8 years ago
JT Thompson's avatar JT Thompson

From my understanding search can only be used on USER fields - and ONLY certain types (https://docs.expressionengine.com/latest/channel/channel_entries.html#search-field-name), the results are correct.

You cannot search on ‘url_title’ it is a parameter NOT a field. You should use the parameter as described in the Docs for that type of query (https://docs.expressionengine.com/latest/channel/channel_entries.html#url-title).

Cheers!

       
Derek Jones's avatar
Derek Jones
7,561 posts
8 years ago
Derek Jones's avatar Derek Jones

Do you just mean to use the url_title= parameter with require_entry='yes' and an {if no_results} redirect? User guide ref

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.