engenes 15 декабря 2017 в 14:31 Мне нужно вывести часть представления (например шапку, подвал, постраничный навигатор или все вместе) программно в определенной части страницы (шапка, подвал, пользовательский блок) как это сделать? Drupal7 Есть вопрос Решение проблем Блог Войдите или зарегистрируйтесь, чтобы отправлять комментарии
adano 15 декабря 2017 в 15:00 https://api.drupal.org/api/views/views.module/function/views_embed_view/... + https://api.drupal.org/api/views/theme%21views-view.tpl.php/7.x-3.x
engenes 15 декабря 2017 в 15:38 читал обе статьи не нашел примера мне нужно вывести header представление попробовал вот так <?php$view = views_get_view('indcatalog');$view_display = $view->display['page'];drupal_set_message('<pre>'.print_r($view_display, true).'</pre>');?> выводит это: <?phpviews_display Object( [handler] => [display_options] => Array ( [query] => Array ( [type] => views_query [options] => Array ( ) ) [path] => avtopark [menu] => Array ( [type] => normal [title] => Автомобили [description] => [name] => main-menu [weight] => 0 [context] => 0 [context_only_inline] => 0 ) [sorts] => Array ( [field_artikul_commerce_price_amount_decimal_asc] => Array ( [id] => field_artikul_commerce_price_amount_decimal_asc [table] => search_api_index_productfilter [field] => field_artikul_commerce_price_amount_decimal_asc [relationship] => none [group_type] => group [ui_name] => [order] => ASC [exposed] => 1 [expose] => Array ( [label] => Сортировать по стоимости [order] => ASC ) ) [views] => Array ( [id] => views [table] => search_api_index_productfilter [field] => views [relationship] => none [group_type] => group [ui_name] => [order] => ASC [exposed] => 1 [expose] => Array ( [label] => Сортировать по популярности [order] => ASC ) ) ) [defaults] => Array ( [sorts] => [filters] => [filter_groups] => ) [filters] => Array ( [field_artikul_title] => Array ( [id] => field_artikul_title [table] => search_api_index_productfilter [field] => field_artikul_title [relationship] => none [group_type] => group [ui_name] => [operator] => = [value] => [group] => 1 [exposed] => 1 [expose] => Array ( [operator_id] => field_artikul_title_op [label] => [description] => [use_operator] => 0 [operator_label] => [operator] => field_artikul_title_op [identifier] => field_artikul_title [required] => 0 [remember] => 0 [multiple] => 0 [remember_roles] => Array ( [2] => 2 [1] => 0 [3] => 0 ) ) [is_grouped] => [group_info] => Array ( [label] => [description] => [identifier] => [optional] => 1 [widget] => select [multiple] => [remember] => 0 [default_group] => All [default_group_multiple] => Array ( ) [group_items] => Array ( ) ) ) ) [filter_groups] => Array ( [operator] => AND [groups] => Array ( [1] => AND ) ) ) [db_table] => views_display [vid] => 30 [id] => page [display_title] => Page [display_plugin] => page [position] => 2)?> можете подсказать как будет выглядеть рабочий код, как вывести header?
Комментарии
https://api.drupal.org/api/views/views.module/function/views_embed_view/...
+
https://api.drupal.org/api/views/theme%21views-view.tpl.php/7.x-3.x
читал обе статьи не нашел примера
мне нужно вывести header представление
попробовал вот так
<?php
$view = views_get_view('indcatalog');
$view_display = $view->display['page'];
drupal_set_message('<pre>'.print_r($view_display, true).'</pre>');
?>
выводит это:
<?php
views_display Object
(
[handler] =>
[display_options] => Array
(
[query] => Array
(
[type] => views_query
[options] => Array
(
)
)
[
path] => avtopark[menu] => Array
(
[type] => normal
[title] => Автомобили
[description] =>
[name] => main-menu
[weight] => 0
[context] => 0
[context_only_inline] => 0
)
[
sorts] => Array(
[field_artikul_commerce_price_amount_decimal_asc] => Array
(
[id] => field_artikul_commerce_price_amount_decimal_asc
[table] => search_api_index_productfilter
[field] => field_artikul_commerce_price_amount_decimal_asc
[relationship] => none
[group_type] => group
[ui_name] =>
[order] => ASC
[exposed] => 1
[expose] => Array
(
[label] => Сортировать по стоимости
[order] => ASC
)
)
[
views] => Array(
[id] => views
[table] => search_api_index_productfilter
[field] => views
[relationship] => none
[group_type] => group
[ui_name] =>
[order] => ASC
[exposed] => 1
[expose] => Array
(
[label] => Сортировать по популярности
[order] => ASC
)
)
)
[
defaults] => Array(
[sorts] =>
[filters] =>
[filter_groups] =>
)
[
filters] => Array(
[field_artikul_title] => Array
(
[id] => field_artikul_title
[table] => search_api_index_productfilter
[field] => field_artikul_title
[relationship] => none
[group_type] => group
[ui_name] =>
[operator] => =
[value] =>
[group] => 1
[exposed] => 1
[expose] => Array
(
[operator_id] => field_artikul_title_op
[label] =>
[description] =>
[use_operator] => 0
[operator_label] =>
[operator] => field_artikul_title_op
[identifier] => field_artikul_title
[required] => 0
[remember] => 0
[multiple] => 0
[remember_roles] => Array
(
[2] => 2
[1] => 0
[3] => 0
)
)
[
is_grouped] =>[group_info] => Array
(
[label] =>
[description] =>
[identifier] =>
[optional] => 1
[widget] => select
[multiple] =>
[remember] => 0
[default_group] => All
[default_group_multiple] => Array
(
)
[
group_items] => Array(
)
)
)
)
[
filter_groups] => Array(
[operator] => AND
[groups] => Array
(
[1] => AND
)
)
)
[
db_table] => views_display[vid] => 30
[id] => page
[display_title] => Page
[display_plugin] => page
[position] => 2
)?>
можете подсказать как будет выглядеть рабочий код, как вывести header?