Drupal сортировка по алфавиту

Перейти к: навигация, поиск 1) Установите модуль Views 2) Перейдите по адресу http://ваш_сайт/admin/structure/views/import 3) Скопируйте и вставьте в "Paste view code here" $view = new view; $view->name = 'glossary'; $view->description = 'A list of all content, by letter.'; $view->tag = 'default'; $view->base_table = 'node'; $view->human_name = 'Glossary'; $view->core = 0; $view->api_version = '3.0'; $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ /* Display: Master */ $handler = $view->new_display('default', 'Master', 'default'); $handler->display->display_options['use_ajax'] = TRUE; $handler->display->display_options['access']['type'] = 'none'; $handler->display->display_options['cache']['type'] = 'none'; $handler->display->display_options['query']['type'] = 'views_query'; $handler->display->display_options['query']['options']['query_comment'] = FALSE; $handler->display->display_options['exposed_form']['type'] = 'basic'; $handler->display->display_options['pager']['type'] = 'full'; $handler->display->display_options['pager']['options']['items_per_page'] = 36; $handler->display->display_options['style_plugin'] = 'table'; $handler->display->display_options['style_options']['columns'] = array( 'title' => 'title', 'name' => 'name', 'changed' => 'changed', ); $handler->display->display_options['style_options']['default'] = 'title'; $handler->display->display_options['style_options']['info'] = array( 'title' => array( 'sortable' => 1, 'separator' => '', ), 'name' => array( 'sortable' => 1, 'separator' => '', ), 'changed' => array( 'sortable' => 1, 'separator' => '', ), ); $handler->display->display_options['style_options']['override'] = 1; $handler->display->display_options['style_options']['sticky'] = 0; /* Relationship: Content: Author */ $handler->display->display_options['relationships']['uid']['id'] = 'uid'; $handler->display->display_options['relationships']['uid']['table'] = 'node'; $handler->display->display_options['relationships']['uid']['field'] = 'uid'; /* Field: Content: Title */ $handler->display->display_options['fields']['title']['id'] = 'title'; $handler->display->display_options['fields']['title']['table'] = 'node'; $handler->display->display_options['fields']['title']['field'] = 'title'; $handler->display->display_options['fields']['title']['link_to_node'] = 1; /* Field: User: Name */ $handler->display->display_options['fields']['name']['id'] = 'name'; $handler->display->display_options['fields']['name']['table'] = 'users'; $handler->display->display_options['fields']['name']['field'] = 'name'; $handler->display->display_options['fields']['name']['relationship'] = 'uid'; $handler->display->display_options['fields']['name']['label'] = 'Author'; $handler->display->display_options['fields']['name']['link_to_user'] = 1; /* Field: Content: Updated date */ $handler->display->display_options['fields']['changed']['id'] = 'changed'; $handler->display->display_options['fields']['changed']['table'] = 'node'; $handler->display->display_options['fields']['changed']['field'] = 'changed'; $handler->display->display_options['fields']['changed']['label'] = 'Last update'; $handler->display->display_options['fields']['changed']['date_format'] = 'large'; /* Contextual filter: Content: Title */ $handler->display->display_options['arguments']['title']['id'] = 'title'; $handler->display->display_options['arguments']['title']['table'] = 'node'; $handler->display->display_options['arguments']['title']['field'] = 'title'; $handler->display->display_options['arguments']['title']['default_action'] = 'default'; $handler->display->display_options['arguments']['title']['exception']['title_enable'] = 1; $handler->display->display_options['arguments']['title']['default_argument_type'] = 'fixed'; $handler->display->display_options['arguments']['title']['default_argument_options']['argument'] = 'a'; $handler->display->display_options['arguments']['title']['summary']['format'] = 'default_summary'; $handler->display->display_options['arguments']['title']['specify_validation'] = 1; $handler->display->display_options['arguments']['title']['glossary'] = 1; $handler->display->display_options['arguments']['title']['limit'] = '1'; $handler->display->display_options['arguments']['title']['case'] = 'upper'; $handler->display->display_options['arguments']['title']['path_case'] = 'lower'; $handler->display->display_options['arguments']['title']['transform_dash'] = 0; /* Display: Page */ $handler = $view->new_display('page', 'Page', 'page'); $handler->display->display_options['path'] = 'glossary'; $handler->display->display_options['menu']['type'] = 'normal'; $handler->display->display_options['menu']['title'] = 'Glossary'; $handler->display->display_options['menu']['weight'] = '0'; /* Display: Attachment */ $handler = $view->new_display('attachment', 'Attachment', 'attachment'); $handler->display->display_options['pager']['type'] = 'none'; $handler->display->display_options['pager']['options']['offset'] = '0'; $handler->display->display_options['defaults']['arguments'] = FALSE; /* Contextual filter: Content: Title */ $handler->display->display_options['arguments']['title']['id'] = 'title'; $handler->display->display_options['arguments']['title']['table'] = 'node'; $handler->display->display_options['arguments']['title']['field'] = 'title'; $handler->display->display_options['arguments']['title']['default_action'] = 'summary'; $handler->display->display_options['arguments']['title']['exception']['title_enable'] = 1; $handler->display->display_options['arguments']['title']['default_argument_type'] = 'fixed'; $handler->display->display_options['arguments']['title']['default_argument_options']['argument'] = 'a'; $handler->display->display_options['arguments']['title']['summary']['format'] = 'unformatted_summary'; $handler->display->display_options['arguments']['title']['summary_options']['items_per_page'] = '25'; $handler->display->display_options['arguments']['title']['summary_options']['inline'] = 1; $handler->display->display_options['arguments']['title']['summary_options']['separator'] = ' | '; $handler->display->display_options['arguments']['title']['specify_validation'] = 1; $handler->display->display_options['arguments']['title']['glossary'] = 1; $handler->display->display_options['arguments']['title']['limit'] = '1'; $handler->display->display_options['arguments']['title']['case'] = 'upper'; $handler->display->display_options['arguments']['title']['path_case'] = 'lower'; $handler->display->display_options['arguments']['title']['transform_dash'] = 0; $handler->display->display_options['displays'] = array( 'default' => 'default', 'page' => 'page', ); $handler->display->display_options['inherit_arguments'] = 0; 4) Сохраните 5) Настройте, как вы хотите Не поленись! Расскажи друзьям!