A Views Slideshow: Dynamic Display Block uses two preprocess functions to convert view fields into template variables. One for the whole slideshow template and one for the pager template.
Important to understand about field data from views used in the preprocess functions.
Install preprocess functions
Note: You can see the view_name and the available field_names by showing the debug info, by setting this in the views ddblock configuration page.
In the example preprocess function the following variables are now available in the slideshow template for each slide.
and the following for each custom-pager-item
Changing view_name and view_field names
If you use a different view_name and view fields than the default news_items view and field names, you have to change them in the preprocess functions.
Show debug info which you can configure at the views ddblock configuration page.
[***THEME_NAME***]_preprocess_views_slideshow_ddblock and [***THEME_NAME***]_preprocess_views_slideshow_ddblock_pager_content
You will now see the result of the drupal_set_message lines, which shows the view_name and the view_fields of your view. You can use this for changing the view_name and the view_field names in the preprocess functions in the template.php file.
Changing view_name
In the line:
if ($settings['view_name'] == 'news_items') {
if ($settings['view_name'] == '[VIEW_NAME]') {
Changing view_field_names
In the lines like:
if (isset($result->node_data_field_pager_item_text_field_slide_text_value)) { $slider_items[$key1]['slide_text'] = check_markup($result->node_data_field_pager_item_text_field_slide_text_value); }
You fill in your own view_field_names
if (isset($result->[VIEW_FIELD_NAME])) { $slider_items[$key1]['slide_text'] = check_markup($result->[VIEW_FIELD_NAME]); }
Note:
After you have changed the view_name and view_field go back to your views ddblock configuration page and set, Show debug info to <none> again.
Recent comments
1 min 27 sec ago
20 hours 37 min ago
1 day 5 hours ago
1 day 22 hours ago
2 days 9 hours ago
3 days 18 hours ago
3 days 19 hours ago
3 days 19 hours ago
3 days 19 hours ago
3 days 19 hours ago