I have a channel with 2 fields, "New Square Footage" and "Remodeled Square Footage". I'm displaying both of these numbers in my template. I want to be able to sort the entries by the total of both of those fields. I currently have a form that will sort based on one of those fields and it works fine using Dynamic Parameters http://ellislab.com/expressionengine/user-guide/modules/channel/dynamic_parameters.html. Any way to add these fields together? I'm not sure if it can be done through the template, or if there needs to be a hidden field in the Publish form that adds them together...Any ideas?
My current form
<ul> <li> <label>Order By:</label> <select name="orderby"> <option value="project_state">State</option> <option value="project_completion_date">Completion Date</option> <option value="project_contract_amount">Contract Amount($)</option> <option value="project_new_sq_ft">Square Footage</option> </select> </li> <li> <label>Sort:</label> <select name="sort"> <option value="asc">Ascending</option> <option value="desc">Descending</option> </select> </li> <li> <input type="submit" value="Go!" /> </li> </ul>
"prject_new_sq_ft" is one of the fields, I need that to be the total of both fields.