开发者

Exported filter with preloaded value

开发者 https://www.devze.com 2023-01-07 12:56 出处:网络
I defined a profile field for users called \"Size\" which can take the values \"Small\", \"Normal\" and \"Big\", so it\'s presented as a combo box.

I defined a profile field for users called "Size" which can take the values "Small", "Normal" and "Big", so it's presented as a combo box. Now I have a Page view with an exposed filter defined over "Size", furthermore the filter is optional so an "Any" value is presented in the combo box.

Two questions:

  1. When the user enters the view page the result list is automatically showed. Can I w开发者_开发技巧ait for the user to click "Search" to display the results?
  2. Can I pre-select the value in the combo box with the value stored for that user in that profile field?, i.e. if the user's value for "Size" is "Big", can I pre-select "Big" in the combo box of the view search page?

Thank you.


  1. No, you cannot. Without to write custom code, it's not possible.
  2. No, you cannot. It would not make sense, anyway, as a view is thought to show the content of possibly multiple elements (user profiles, in this case). Which value should the filter show? The value of the first user profile shown?

It is possible to make a filter show the last value a user selected. Supposing that user A selects Big, then all the times user A watches that view, he will see the user profiles for which the field Size contains the value Big. User A can obviously change the value of the filter all times he wants.

0

精彩评论

暂无评论...
验证码 换一张
取 消