Below code ignores my search:title parameter. It still just spits out everything (only 2 posts thus far). I can’t seem to figure out what it doesn’t search for “test” as I’m asking it to. Also, the tag {if no_results} doesn’t show anything either at any time.
What have I done wrong?
template: /search/result (simplified)
{exp:channel:entries channel="nyheter|sidor" search:title="test}
{title}
{/exp:channel:entries}
{if no_results}
No result
{/if}That was just a type by me. I do have the closing quote in my code.
It still doesn’t work. My EE installation is pretty much default stuff.
How can I debug this? Really would like to have this work. Or I’d have to find a way of making an Ajax search form that takes use of EE’s default search module. Is there a pre-made mod for the EE forms that spits out whatever search result there is to a div?
Having the no_results tag inside the exp:channel:entries function helped. It’s not always pointed out if it should be inside outside, but I believe most of the time it should be inside right?
The search: parameter works only for custom fields - the title is not a custom field, so this won’t work.
I could swear that Mark Bowen had an add-on to do this, but I can’t seem to find it. :( You may need a custom query to accomplish this.
I could swear that Mark Bowen had an add-on to do this, but I can’t seem to find it.
Sorry, nothing made by me to achieve this I’m afraid :-(
I think you may have been thinking of Mark Croxton here maybe? - http://ellislab.com/forums/viewthread/130518/ | http://devot-ee.com/add-ons/search-fields
Best wishes,
Mark
Hrm, I thought the one I was thinking of was very specifically the title only. But you may be right, Mark. Thank you. =)
No problem. Actually there was an extension that someone made due to a question I had which basically copied whatever was in the title field into a custom field so that you could then search using that field instead.
I’ve not really gotten into extension development in 2.x that strongly yet although I’m fairly certain it could probably be ported over.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.