Using dynamic parameters with custom fields
Posted: 03 July 2009 09:29 AM   [ Ignore ]  
Grad Student
Rank
Total Posts:  40
Joined  02-20-2009

Hi,

I want to set up a form which allows users to search for weblog entries contained within a specific weblog, but by specifying the value of a number of custom fields.  I stumbled upon dynamic parameters, which seems to be the tool for the essence of the task, but it only seems to be documented to allow for using the 40 or so predefined parameters.

So, is there way to constrain results by custom fields like is possible using the search: feature?

Or is there a better/easier way?

Seems like a staple task that would be baked in somewhere but I cannot see it.

Thanks!

Profile
 
 
Posted: 03 July 2009 01:40 PM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  921
Joined  06-24-2007

Yes you can use search:custom_field_name in a Dynamic Parameters form

the basic code for a select box looks like this…

<select name="search:custom_field_name">
<
option value="yes">Yes</option>
<
option value="no">No</option>
</
select>

The values can either be hard coded or generated dymanically from existing values.

 Signature 

Rob - http://www.blue-dreamer.co.uk/ - because I like blue!
EE Pro Network member

Profile
 
 
Posted: 04 July 2009 12:57 PM   [ Ignore ]   [ # 2 ]  
Grad Student
Rank
Total Posts:  40
Joined  02-20-2009

Perfect, thanks Rob! smile

Profile
 
 
Posted: 05 July 2009 10:18 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  921
Joined  06-24-2007

No probs, I take it that worked?

 Signature 

Rob - http://www.blue-dreamer.co.uk/ - because I like blue!
EE Pro Network member

Profile
 
 
Posted: 06 July 2009 03:21 AM   [ Ignore ]   [ # 4 ]  
Grad Student
Rank
Total Posts:  40
Joined  02-20-2009

Yes, I tested that and it works perfectly.

I am now grappling with a way to do the same thing but allowing users to select multiple options per custom field.  From a front end point of view that’s easy to do, but will EE take multiple values using dynamic parameters?

Thanks

Profile
 
 
Posted: 06 July 2009 06:25 AM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  921
Joined  06-24-2007

I haven’t tried this but you could try using checkboxes…

<input type="checkbox" id="c1" name="search:custom_field_name" value="red" /> <label for="c1">Red</label>
<
input type="checkbox" id="c2" name="search:custom_field_name" value="green" /> <label for="c2">Red</label>
<
input type="checkbox" id="c3" name="search:custom_field_name" value="blue" /> <label for="c3">Blue</label>
 Signature 

Rob - http://www.blue-dreamer.co.uk/ - because I like blue!
EE Pro Network member

Profile
 
 
Posted: 06 July 2009 07:16 AM   [ Ignore ]   [ # 6 ]  
Grad Student
Rank
Total Posts:  40
Joined  02-20-2009

Unfortunately that doesn’t work :(

Profile
 
 
Posted: 06 July 2009 08:39 AM   [ Ignore ]   [ # 7 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  921
Joined  06-24-2007

It was a long shot smile

Last go, try it with a multiple select…

<select name='search:custom_field_name' size='5' multiple='multiple'>
<
option value=''>Everything</option>
<
option value='red'>Red</option>
<
option value='green'>Green</option>
<
option value='blue'>Blue</option>
</
select>

If that doesn’t work either it’s not going to or you’d need a bit of custom scripting.

 Signature 

Rob - http://www.blue-dreamer.co.uk/ - because I like blue!
EE Pro Network member

Profile
 
 
Posted: 08 July 2009 03:14 AM   [ Ignore ]   [ # 8 ]  
Grad Student
Rank
Total Posts:  40
Joined  02-20-2009

Nope - the posted page would get the same data using both methods.

Thanks for all your help - going back to single option radios for now.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 02:47 PM
Total Registered Members: 115026 Total Logged-in Users: 126
Total Topics: 122461 Total Anonymous Users: 66
Total Replies: 647364 Total Guests: 531
Total Posts: 769825    
Members ( View Memberlist )
Active Members:    .jb3000a38dadlurAlexis Moore-JonesAndrew MacphersonAracne editrice S.r.l.atiosisÑuño MartínezBennobobluedreamerBrent BurgoynebuckycatBud Parr | Sonnet Media LLCBurly Chassiscc000001Chris ClarkeChris Newtonchrisbarber86Christian Schultecmw1Compass360CrucialDan HalbertdaverodDavid Barrett (Contrast)davidandliladeckard97demotivedesignerhandbagsDitchmonkeyDLMADoug EDouglas ReeddstechroomErik ReaganetoshaeuetzExayleeyelidlessnessForrest AndersonfusioeegesturestudioGnuusgomacroGreg Akergrovberggrrrampsguru24GwarrioriamnickITWYJAM1515Jason FerrellJay FjeffkonczJenSkimjmorinjoemoJohnDjohnniefpjonparadise2JT Thompsonjulie pKevin EvanslaureentlaurentPLaurie RuggleslebisollifetreecreativeliquidbookliverpoolrcLLeakelorigoldbergMarc MillerMario RodríguezMatt HarrisMatthias HinrichsmelissajcMichael Byströmmikepicmjfr226Mr GoongsneostructuralistNevin LyneNico SmitnimbleslickNoah Kuhnnoddypab514Pascal KrietePeeTERPhil NortonpMacedqbrandsrchostingregistryRenmanResponse1rippeRobb OttenhoffRobert AitkenrobertbanhrussliptonRyan FaubionsargianteSean McDevittShane AveryshinkaSky Small ProjectssmartpillspinhirneSteve FairhurstSteven GrantStumpieSuper McFlytimprinttimurTodd SvobtoaviWayne Smallmanyabdabzackmorgan