Orchard Create Projection or Search Based on Filtered Dropdown Selections

你。 提交于 2019-12-03 06:26:19

You can definitely use a projection. If you notice when you use the search function on the page you referenced, the inputs are formed into query string values. You can use tokens to grab the values from query strings to use in your projection filter. For example, if you're using fields as you stated, then you just add a filter for that field and in the value field use {Request.QueryString:State}. Or, replace "State" with whatever key you're using for the query string value.

That solves your projection issue. You will need to build a search form that would look something like this...

<form action="/search-results" method="Get">
  <select name="State">
     <option value="OH">Ohio</option>
     ...all the states...
  </select>
  <input type="submit" value="Search" />
</form>

"/search-results" could be a projection page or any content that has the projection widget present. You could build the form as a widget that you can place somewhere, or for testing purposes, you could just paste this html into an html widget to try it out.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!