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

Searching custom fields

Development and Programming

webnology's avatar
webnology
352 posts
16 years ago
webnology's avatar webnology

Hi all,

I need to search my weblog entries for these values:

Name (input field) Company (input field) Industry (drop down) Competence (checkbox)

All these are custom fields.

I’m uing Mark Bowen’s plugin, but I can’t seem to make it work. For now I have only the Industry there:

{exp:search:simple_form weblog="membership_directory" search_in="everywhere" result_page="search-result"}
<select id="{exp:custom_drop_down:field_id field_name="industry"}" name="{exp:custom_drop_down:field_id field_name="industry"}">
{exp:custom_drop_down field_name="industry" initial_value_value="my-value" initial_value_option="Choose an industry..."}
<option value="{value}">{value}</option>
{/exp:custom_drop_down}
</select>
<input type="submit" value="submit" class="submit" />
{/exp:search:simple_form}

I get the error that no search term has been submitted. Can anyone help me out to make this work, please?

Kind regards, Michel

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Hi Michel,

I could be wrong but I don’t think that the search forms allow you to add in your own custom fields to them. You can only use the code as shown in the documentation. That would explain why it’s not working. I would love to be proved wrong on this though as I’d love to do this myself personally 😉 so if anyone knows then do please tell!!

The only other way that I can think of getting it to do what you want would be to use the search term from the drop-down list in conjunction with the search://body=”“ parameter in a weblog tag as shown on this page here.

Hope that helps a bit and I do hope that I’m wrong on this as it would come in really handy for something I might need to do soon!! 😊

Best wishes,

Mark

       
webnology's avatar
webnology
352 posts
16 years ago
webnology's avatar webnology

ok, thx. That sounds bad ;-(. I’ll write the php code myself then. Strange though, this seems a normal feature for a cms, no? EE2?

Michel

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
ok, thx. That sounds bad ;-(. I’ll write the php code myself then. Strange though, this seems a normal feature for a cms, no? EE2? Michel

Yep please don’t quote me on what I said as I know there never used to be a way of doing it and I’m fairly certain that may well still be the case but you can definitely do the same sort of search by using the search parameter on a weblog tag if that helps at all.

I would love to be proved wrong on the first point though as I wouldn’t mind being able to do that myself 😉 Perhaps one of the dev team could pop in here and answer this for us though.

Best wishes,

Mark

       

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.