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.
Comments
HI, what do you mean ddblock
HI, what do you mean ddblock configuration page? and show debug info? where do i find those?
Re: HI, what do you mean ddblock
An explanation where to find the configuration page can be found in the Configure News item slideshow views block settings page and Configure ddblock slideshow pages.
preprocessing problem
hi
i followed your informative tutorial and i ve learnt a lot. but when i reached the stage of the last part preprocessing i encountred this problem:
first i opened the template.php.txt file and changed the name to garland but i was very confused later.
according to this tutorial i should copy and paste template.php.txt file content to the template.php and upload it to themes/ garland and i overwrote the old template.php but when i refresh i have a posted error msg.
plz help and explain to me this stage i ve spent more than 4 hours redoing it.
thanks
Re: preprocessing problem
You should copy the content of the template.php.txt file to your existing template.php file of the theme you use for your site.
Please create an issue in the issue queue of the views_slideshow_ddblock module.
Attach your template.php file, the result of the debug lines and a link to the slideshow on your Internet site.
What is the error you get?