Whatever field you want to order by (probably node title), add it to the Sort section of the view and choose Asc order. That'll display the view in alphabetical order.
Thank you very much .. indeed on the title it does the job but I should have specified (my fault) that I wanted to sort by grouped fields and by alpahbetic sort on this grouped field
This is what I did and I have the same result and more i have many times the same node because some nodes belong to more than one categories..maybe that i want to do is not feasible and i should find a workaround ..
For the multiple nodes showing up, maybe try various combinations of aggregation and distinct settings. They are both in the right-most column, in the Other section. The distinct settings are in the Query settings area. I would start with the distinct and pure distinct settings to see if they help.
Hi @DianeBAS
It doesn't look like there are any port requests for these modules and they do not appear in https://github.com/backdrop-contrib so it doesn't look like anybody has tried anything unless...
Thanks for those ideas. Here is what I'm doing now that works.
This adds the video_filter to the config file.
$format = filter_format_load('filtered_html');
$format->filters['video_filter'] = (...
The port of Organic Groups is within days (if not hours) of a beta release. Feel free to help test and report issues.
https://github.com/backdrop-contrib/og
I agree with BWPanda about the better way to add a filter. As for your general question on how to add an array to a config file (which gets stored as json), have you tried:
$config = config('...
I think that directly editing config is rarely, if ever, the best way to do something...
Perhaps try loading a format (with it's filters) using filter_format_load(), add the new filter array (by...
Posted22 hours 30 min ago by Peter Anderson (BWPanda) on:
Comments
Whatever field you want to order by (probably node title), add it to the Sort section of the view and choose Asc order. That'll display the view in alphabetical order.
Just adding a screenshot to support the advice from @BWPanda.
Thank you very much .. indeed on the title it does the job but I should have specified (my fault) that I wanted to sort by grouped fields and by alpahbetic sort on this grouped field
Whatever the grouped field is, add it to the sort section then.
If you still have trouble, maybe post an export of the view we can look at.
{
"_config_name": "views.view.block_de_vue_des_videos_du_meme_auteur",
"name": "block_de_vue_des_videos_du_meme_auteur",
"description": "",
"tag": "default",
"disabled": false,
"base_table": "node",
"human_name": "Liste standard des vidéos de science",
"core": "1.17.1",
"display": {
"default": {
"display_title": "Master",
"display_plugin": "default",
"display_options": {
"query": {
"type": "views_query",
"options": []
},
"access": {
"type": "perm",
"perm": "access content"
},
"cache": {
"type": "none"
},
"exposed_form": {
"type": "better_exposed_filters",
"options": {
"submit_button": "Appliquer",
"reset_button": 1,
"reset_button_label": "Réinitialiser",
"exposed_sorts_label": "Trier par",
"expose_sort_order": 1,
"sort_asc_label": "Asc",
"sort_desc_label": "Desc",
"autosubmit": 1,
"autosubmit_hide": 1,
"bef": {
"general": {
"input_required": 0,
"text_input_required": {
"text_input_required": {
"value": "
Select any filter and click on Apply to see results
\r\n",
"format": "full_html"
}
},
"allow_secondary": 0,
"secondary_label": "Options avancées"
},
"field_definition_du_domaine_target_id": {
"bef_format": "default",
"more_options": {
"bef_select_all_none": false,
"bef_collapsible": 0,
"is_secondary": 0,
"any_label": "",
"bef_filter_description": "",
"rewrite": {
"filter_rewrite_values": ""
}
}
},
"field_ecrivain_auteur_presentate_target_id": {
"bef_format": "default",
"more_options": {
"bef_select_all_none": false,
"bef_collapsible": 0,
"is_secondary": 0,
"any_label": "",
"bef_filter_description": "",
"rewrite": {
"filter_rewrite_values": ""
}
}
}
}
}
},
"pager": {
"type": "none",
"options": {
"offset": "0"
}
},
"style_plugin": "views_bootstrap_grid_plugin_style",
"row_plugin": "fields",
"fields": {
"title": {
"id": "title",
"table": "node",
"field": "title",
"relationship": "none",
"group_type": "group",
"ui_name": "",
"label": "",
"exclude": 0,
"alter": {
"alter_text": 1,
"text": "",
"make_link": 0,
"path": "",
"absolute": 0,
"external": 0,
"replace_spaces": 0,
"path_case": "none",
"trim_whitespace": 0,
"alt": "",
"rel": "",
"link_class": "",
"prefix": "",
"suffix": "",
"target": "",
"nl2br": 0,
"max_length": "40",
"word_boundary": 1,
"ellipsis": 0,
"more_link": 0,
"more_link_text": "",
"more_link_path": "",
"strip_tags": 0,
"trim": 1,
"preserve_tags": "",
"html": 0
},
"element_type": "h2",
"element_class": "",
"element_label_type": "",
"element_label_class": "",
"element_label_colon": false,
"element_wrapper_type": "",
"element_wrapper_class": "",
"element_default_classes": 1,
"empty": "",
"hide_empty": 0,
"empty_zero": 0,
"hide_alter_empty": 1,
"link_to_node": 1
},
"field_video2": {
"id": "field_video2",
"table": "field_data_field_video2",
"field": "field_video2",
"relationship": "none",
"group_type": "group",
"ui_name": "",
"label": "",
"exclude": 0,
"alter": {
"alter_text": 0,
"text": "",
"make_link": 0,
"path": "",
"absolute": 0,
"external": 0,
"replace_spaces": 0,
"path_case": "none",
"trim_whitespace": 1,
"alt": "",
"rel": "",
"link_class": "",
"prefix": "",
"suffix": "",
"target": "",
"nl2br": 0,
"max_length": "",
"word_boundary": 1,
"ellipsis": 1,
"more_link": 0,
"more_link_text": "",
"more_link_path": "",
"strip_tags": 0,
"trim": 0,
"preserve_tags": "",
"html": 0
},
"element_type": "div",
"element_class": "bordure03",
"element_label_type": "",
"element_label_class": "",
"element_label_colon": false,
"element_wrapper_type": "",
"element_wrapper_class": "",
"element_default_classes": 1,
"empty": "Pas de vidéo de cet auteur",
"hide_empty": 0,
"empty_zero": 1,
"hide_alter_empty": 0,
"click_sort_column": "input",
"type": "youtube_thumbnail",
"settings": {
"image_style": "",
"image_link": "content",
"colorbox": {
"parameters": {
"width": "1040",
"height": "680",
"autoplay": 1,
"loop": 0,
"showinfo": 0,
"controls": 0,
"autohide": 0,
"iv_load_policy": 0
},
"gallery": 0
}
},
"group_column": "",
"group_columns": [],
"group_rows": true,
"delta_limit": "all",
"delta_offset": 0,
"delta_reversed": false,
"delta_first_last": false,
"multi_type": "separator",
"separator": ", ",
"field_api_classes": 0
},
"field_image": {
"id": "field_image",
"table": "field_data_field_image",
"field": "field_image",
"relationship": "none",
"group_type": "group",
"ui_name": "",
"label": "",
"exclude": 0,
"alter": {
"alter_text": 1,
"text": "",
"make_link": 0,
"path": "",
"absolute": 0,
"external": 0,
"replace_spaces": 0,
"path_case": "none",
"trim_whitespace": 0,
"alt": "",
"rel": "",
"link_class": "",
"prefix": "",
"suffix": "",
"target": "",
"nl2br": 0,
"max_length": "",
"word_boundary": 1,
"ellipsis": 1,
"more_link": 0,
"more_link_text": "",
"more_link_path": "",
"strip_tags": 0,
"trim": 0,
"preserve_tags": "",
"html": 0
},
"element_type": "span",
"element_class": "",
"element_label_type": "",
"element_label_class": "",
"element_label_colon": false,
"element_wrapper_type": "",
"element_wrapper_class": "",
"element_default_classes": 1,
"empty": "",
"hide_empty": 0,
"empty_zero": 0,
"hide_alter_empty": 1,
"click_sort_column": "fid",
"type": "image",
"settings": {
"image_style": "livre_intro",
"image_link": "content",
"image_float": "left",
"image_load": "auto"
},
"group_column": "",
"group_columns": [],
"group_rows": true,
"delta_limit": "all",
"delta_offset": 0,
"delta_reversed": false,
"delta_first_last": false,
"multi_type": "separator",
"separator": ", ",
"field_api_classes": 0
},
"field_node_vers_domaine": {
"id": "field_node_vers_domaine",
"table": "field_data_field_node_vers_domaine",
"field": "field_node_vers_domaine",
"relationship": "none",
"group_type": "group",
"ui_name": "",
"label": "",
"exclude": 1,
"alter": {
"alter_text": 1,
"text": "",
"make_link": 0,
"path": "",
"absolute": 0,
"external": 0,
"replace_spaces": 0,
"path_case": "none",
"trim_whitespace": 0,
"alt": "",
"rel": "",
"link_class": "",
"prefix": "",
"suffix": "",
"target": "",
"nl2br": 0,
"max_length": "",
"word_boundary": 1,
"ellipsis": 1,
"more_link": 0,
"more_link_text": "",
"more_link_path": "",
"strip_tags": 0,
"trim": 0,
"preserve_tags": "",
"html": 0
},
"element_type": "",
"element_class": "",
"element_label_type": "",
"element_label_class": "",
"element_label_colon": false,
"element_wrapper_type": "",
"element_wrapper_class": "",
"element_default_classes": 1,
"empty": "",
"hide_empty": 0,
"empty_zero": 0,
"hide_alter_empty": 1,
"click_sort_column": "nid",
"type": "node_reference_default",
"settings": [],
"group_column": "nid",
"group_columns": [],
"group_rows": 1,
"delta_limit": "all",
"delta_offset": "0",
"delta_reversed": 0,
"delta_first_last": 0,
"multi_type": "separator",
"separator": ", ",
"field_api_classes": 0
},
"field_node_vers_auteur": {
"id": "field_node_vers_auteur",
"table": "field_data_field_node_vers_auteur",
"field": "field_node_vers_auteur",
"relationship": "none",
"group_type": "group",
"ui_name": "",
"label": "Auteur",
"exclude": 1,
"alter": {
"alter_text": 0,
"text": "",
"make_link": 0,
"path": "",
"absolute": 0,
"external": 0,
"replace_spaces": 0,
"path_case": "none",
"trim_whitespace": 0,
"alt": "",
"rel": "",
"link_class": "",
"prefix": "",
"suffix": "",
"target": "",
"nl2br": 0,
"max_length": "",
"word_boundary": 1,
"ellipsis": 1,
"more_link": 0,
"more_link_text": "",
"more_link_path": "",
"strip_tags": 0,
"trim": 0,
"preserve_tags": "",
"html": 0
},
"element_type": "",
"element_class": "",
"element_label_type": "",
"element_label_class": "",
"element_label_colon": 1,
"element_wrapper_type": "",
"element_wrapper_class": "",
"element_default_classes": 1,
"empty": "",
"hide_empty": 0,
"empty_zero": 0,
"hide_alter_empty": 1,
"click_sort_column": "nid",
"type": "node_reference_default",
"settings": [],
"group_column": "nid",
"group_columns": [],
"group_rows": 1,
"delta_limit": "all",
"delta_offset": "0",
"delta_reversed": 0,
"delta_first_last": 0,
"multi_type": "separator",
"separator": ", ",
"field_api_classes": 0
}
},
"filters": {
"status": {
"value": 1,
"table": "node",
"field": "status",
"id": "status",
"expose": {
"operator": false
},
"group": 1
},
"type": {
"id": "type",
"table": "node",
"field": "type",
"relationship": "none",
"group_type": "group",
"ui_name": "",
"operator": "in",
"value": {
"videoscience": "videoscience"
},
"group": 1,
"exposed": false,
"expose": {
"operator_id": "type_op",
"label": "Type de publication",
"description": "",
"use_operator": 0,
"operator": "type_op",
"identifier": "type",
"required": 0,
"remember": 0,
"multiple": 0,
"remember_roles": {
"authenticated": "authenticated",
"anonymous": 0,
"editor": 0,
"administrator": 0
},
"reduce": 1
},
"is_grouped": false,
"group_info": {
"label": "Type",
"description": "",
"identifier": "type",
"optional": 1,
"widget": "radios",
"multiple": 0,
"remember": 0,
"default_group": "1",
"default_group_multiple": [],
"group_items": {
"1": {
"title": "filtre 1",
"operator": "in",
"value": {
"domaine_scientifique": "domaine_scientifique",
"ecrivains_auteurs_presentateurs": "ecrivains_auteurs_presentateurs",
"livre": "livre",
"videoscience": "videoscience",
"video_de_musique": "video_de_musique",
"all": 0,
"post": 0,
"date": 0,
"instrument": 0,
"layout_node": 0,
"page": 0,
"book": 0,
"webform": 0,
"bundle_image": 0
}
},
"2": {
"title": "filtre 2",
"operator": "in",
"value": {
"domaine_scientifique": "domaine_scientifique",
"ecrivains_auteurs_presentateurs": "ecrivains_auteurs_presentateurs",
"livre": "livre",
"videoscience": "videoscience",
"video_de_musique": "video_de_musique",
"all": 0,
"post": 0,
"date": 0,
"instrument": 0,
"layout_node": 0,
"page": 0,
"book": 0,
"webform": 0,
"bundle_image": 0
}
},
"3": {
"title": "filtre 3",
"operator": "in",
"value": {
"domaine_scientifique": "domaine_scientifique",
"ecrivains_auteurs_presentateurs": "ecrivains_auteurs_presentateurs",
"livre": "livre",
"videoscience": "videoscience",
"video_de_musique": "video_de_musique",
"all": 0,
"post": 0,
"date": 0,
"instrument": 0,
"layout_node": 0,
"page": 0,
"book": 0,
"webform": 0,
"bundle_image": 0
}
}
}
}
},
"field_node_vers_domaine_nid": {
"id": "field_node_vers_domaine_nid",
"table": "field_data_field_node_vers_domaine",
"field": "field_node_vers_domaine_nid",
"relationship": "none",
"group_type": "group",
"ui_name": "",
"operator": "in",
"value": [],
"group": "1",
"exposed": true,
"expose": {
"operator_id": "field_node_vers_domaine_nid_op",
"label": "Domaines ",
"description": "",
"use_operator": 0,
"operator": "field_node_vers_domaine_nid_op",
"identifier": "field_node_vers_domaine_nid",
"required": 0,
"remember": 0,
"multiple": 0,
"remember_roles": {
"authenticated": "authenticated",
"anonymous": 0,
"editor": 0,
"administrator": 0
},
"reduce": 0
},
"is_grouped": false,
"group_info": {
"label": "",
"description": "",
"identifier": "",
"optional": true,
"widget": "select",
"multiple": false,
"remember": 0,
"default_group": "All",
"default_group_multiple": [],
"group_items": []
}
},
"field_node_vers_auteur_nid": {
"id": "field_node_vers_auteur_nid",
"table": "field_data_field_node_vers_auteur",
"field": "field_node_vers_auteur_nid",
"relationship": "none",
"group_type": "group",
"ui_name": "",
"operator": "in",
"value": [],
"group": "1",
"exposed": true,
"expose": {
"operator_id": "field_node_vers_auteur_nid_op",
"label": "Auteurs ",
"description": "",
"use_operator": 0,
"operator": "field_node_vers_auteur_nid_op",
"identifier": "field_node_vers_auteur_nid",
"required": 0,
"remember": 0,
"multiple": 0,
"remember_roles": {
"authenticated": "authenticated",
"anonymous": 0,
"editor": 0,
"administrator": 0
},
"reduce": 0
},
"is_grouped": false,
"group_info": {
"label": "",
"description": "",
"identifier": "",
"optional": true,
"widget": "select",
"multiple": false,
"remember": 0,
"default_group": "All",
"default_group_multiple": [],
"group_items": []
}
}
},
"sorts": {
"title": {
"id": "title",
"table": "node",
"field": "title",
"relationship": "none",
"group_type": "group",
"ui_name": "",
"order": "ASC",
"exposed": false,
"expose": {
"label": ""
}
}
},
"title": "Vidéos de Sciences",
"row_options": {
"default_field_elements": 1,
"inline": [],
"separator": "",
"hide_empty": 0
},
"use_ajax": true,
"style_options": {
"grouping": [],
"alignment": "horizontal",
"columns": "2",
"class_prefix": "col-sm"
},
"arguments": [],
"relationships": [],
"empty": [],
"filter_groups": {
"operator": "AND",
"groups": {
"1": "AND"
}
},
"link_display": "page",
"css_class": ""
}
},
"page": {
"display_title": "Page",
"display_plugin": "page",
"display_options": {
"query": {
"type": "views_query",
"options": []
},
"path": "sciences/vue-des-videos-de-science-avec-selecteurs",
"menu": {
"type": "normal",
"title": "Vidéos de science ",
"description": "",
"name": "main-menu",
"weight": "0",
"context": 0,
"context_only_inline": 0
},
"style_plugin": "views_bootstrap_grid_plugin_style",
"defaults": {
"style_plugin": false,
"style_options": false,
"row_plugin": false,
"row_options": false
},
"style_options": {
"grouping": [
{
"field": "field_node_vers_domaine",
"rendered": 1,
"rendered_strip": 0
}
],
"alignment": "horizontal",
"columns": "4",
"class_prefix": "col-sm"
},
"row_plugin": "fields",
"row_options": {
"default_field_elements": 1,
"inline": [],
"separator": "",
"hide_empty": 0
},
"exposed_block": false
}
},
"entityreference_1": {
"display_title": "Entity Reference",
"display_plugin": "entityreference",
"display_options": {
"query": {
"type": "views_query",
"options": []
},
"style_options": {
"grouping": [
{
"field": "title",
"rendered": 1,
"rendered_strip": 0
}
],
"search_fields": {
"title": "title"
}
},
"row_options": {
"default_field_elements": 1,
"inline": {
"title": "title"
},
"separator": "-",
"hide_empty": 0
}
}
},
"block_de_liste_standard_des_videos_de_sciences": {
"display_title": "Bloc",
"display_plugin": "block",
"display_options": {
"query": {
"type": "views_query",
"options": []
},
"block_description": "block de liste standard des vidéos de sciences",
"inherit_path": "1",
"exposed_block": false,
"style_plugin": "views_bootstrap_grid_plugin_style",
"defaults": {
"style_plugin": false,
"style_options": false,
"row_plugin": false,
"row_options": false,
"pager": false,
"pager_options": false,
"title": false,
"exposed_form": false,
"exposed_form_options": false
},
"style_options": {
"grouping": [],
"alignment": "horizontal",
"columns": "3",
"class_prefix": "col-sm"
},
"row_plugin": "fields",
"row_options": {
"default_field_elements": 1,
"inline": [],
"separator": "",
"hide_empty": 0
},
"pager": {
"type": "none",
"options": {
"offset": "0"
}
},
"pager_options": null,
"link_to_view": "1",
"link_url": "",
"title": "",
"exposed_form": {
"type": "better_exposed_filters",
"options": {
"submit_button": "Appliquer",
"reset_button": 1,
"reset_button_label": "Réinitialiser",
"exposed_sorts_label": "Trier par",
"expose_sort_order": 0,
"sort_asc_label": "Asc",
"sort_desc_label": "Desc",
"autosubmit": 1,
"autosubmit_hide": 1,
"bef": {
"general": {
"input_required": 0,
"text_input_required": {
"text_input_required": {
"value": "
Select any filter and click on Apply to see results
\r\n",
"format": "filtered_html"
}
},
"allow_secondary": 0,
"secondary_label": "Options avancées"
},
"field_definition_du_domaine_target_id": {
"bef_format": "default",
"more_options": {
"bef_select_all_none": false,
"bef_collapsible": 0,
"is_secondary": 0,
"any_label": "",
"bef_filter_description": "",
"rewrite": {
"filter_rewrite_values": ""
}
}
},
"field_ecrivain_auteur_presentate_target_id": {
"bef_format": "default",
"more_options": {
"bef_select_all_none": false,
"bef_collapsible": 0,
"is_secondary": 0,
"any_label": "",
"bef_filter_description": "",
"rewrite": {
"filter_rewrite_values": ""
}
}
}
}
}
},
"exposed_form_options": null
}
}
}
}
It looks like your Page view is being grouped by the 'field_node_vers_domaine' field. So this is the one you need to Sort by.
This is what I did and I have the same result and more i have many times the same node because some nodes belong to more than one categories..maybe that i want to do is not feasible and i should find a workaround ..
For the multiple nodes showing up, maybe try various combinations of aggregation and distinct settings. They are both in the right-most column, in the Other section. The distinct settings are in the Query settings area. I would start with the distinct and pure distinct settings to see if they help.
Thanks the suggestion; i have tried but don't work either ..