Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

Search/sort problem in Flex-object Directory

plugins

Solved by Tiziana Stoto View solution

Started by Tiziana Stoto 6 years ago · 1 replies · 449 views
6 years ago

Hello everybody,

I copied the contacts example into testone following the documentation in order to add a new field called 'journal' and everything works perfectly well.
However, when I display my testone collection of objects in the directory I cannot search or sort using the new field journal. Both search and sort work only for name and email like in the original contact example.

Here is what I wrote in user/blueprint/flex-object/testone.yaml

YAML
search:
  # Search options
  options:
    contains: 1
  # Fields to be searched
  fields:
    - last_name
    - first_name
    - email
    - journal

and in user/themes/deliver/templates/flex/testone/collection/default.html.twig

<script>
var options = {
valueNames: [ 'name', 'email', 'website', 'journal', 'entry-extra' ]
};
var flexList = new List('flex-objects', options);
</script>

Did I forget anything?
Thank you very very much in advance for your help!

Suggested topics

Topic Participants Replies Views Activity
Support · by Water Science, 3 weeks ago
11 165 4 hours ago
Support · by Duc , 19 hours ago
1 43 19 hours ago
Support · by Thomas, 1 week ago
3 116 1 day ago
Support · by Anna, 4 days ago
2 109 2 days ago
Support · by Justin Young, 2 days ago
1 86 2 days ago