Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Search/sort problem in Flex-object Directory

plugins

Solved by Tiziana Stoto View solution

Started by Tiziana Stoto 6 years ago · 1 replies · 668 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 webmasterodp, 1 week ago
4 163 1 week ago
Support · by nwhitfield, 1 week ago
2 142 1 week ago
Support · by stell, 3 weeks ago
5 374 2 weeks ago
Support · by gravinator, 1 month ago
5 567 2 weeks ago
Support · by Gravver, 3 weeks ago
6 354 3 weeks ago