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.

Filtering Weblog by Custom Field

March 31, 2010 12:19pm

Subscribe [1]
  • #1 / Mar 31, 2010 12:19pm

    soulstrut

    5 posts

    I know this is a very mundane question, but I have found no concise documentation.

    I’m trying to find code that will allow me to have a dropdown menu populated with custom field entries.

    For instance, the cf is FRUIT… and the entries are apples, oranges, bananas, etc.  The user would select apples and the same template page would refresh with all entries with apples.

    Can someone please post some example code.  I’m killing myself here.

    Thanks in advance.

  • #2 / Mar 31, 2010 2:01pm

    Rob Allen

    3105 posts

    You might want to look at Dynamic parameters.

    You can create a filter SELECT element by manually adding values like…

    <form method="post" action="{path="template_group/template_name"}">
    
    <select name="search:your_fruit_custom_field">
    <option value="apples">Apples</option>
    <option value="oranges">Oranges</option>
    <option value="bananas">Bananas</option>
    </select>
    
    <input type="submit" value="Go!" />
    
    </form>

    Otherwise you’d need a custom query to pull in existing values automatically.

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

ExpressionEngine News!

#eecms, #events, #releases