Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Created a view with views slideshow. The purpose is to show a clickable logo, whichs leads to the sponsor's website.
The images (from media 2.0) are shown, but the link is not working. Any suggestions?
$view = new view();
$view->name = 'sponsor_caroussel';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Sponsor caroussel';
$view->core = 7;
$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_more_always'] = FALSE;
$handler->display->display_options['use_more_text'] = 'meer';
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['exposed_form']['options']['submit_button'] = 'Toepassen';
$handler->display->display_options['exposed_form']['options']['reset_button_label'] = 'Opnieuw instellen';
$handler->display->display_options['exposed_form']['options']['exposed_sorts_label'] = 'Sorteer op';
$handler->display->display_options['exposed_form']['options']['sort_asc_label'] = 'Oplopend';
$handler->display->display_options['exposed_form']['options']['sort_desc_label'] = 'Aflopend';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'slideshow';
$handler->display->display_options['row_plugin'] = 'fields';
/* Veld: Inhoud: Website */
$handler->display->display_options['fields']['field_sponsor_website']['id'] = 'field_sponsor_website';
$handler->display->display_options['fields']['field_sponsor_website']['table'] = 'field_data_field_sponsor_website';
$handler->display->display_options['fields']['field_sponsor_website']['field'] = 'field_sponsor_website';
$handler->display->display_options['fields']['field_sponsor_website']['label'] = '';
$handler->display->display_options['fields']['field_sponsor_website']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_sponsor_website']['click_sort_column'] = 'url';
$handler->display->display_options['fields']['field_sponsor_website']['type'] = 'link_absolute';
/* Veld: Inhoud: Logo */
$handler->display->display_options['fields']['field_sponsor_logo']['id'] = 'field_sponsor_logo';
$handler->display->display_options['fields']['field_sponsor_logo']['table'] = 'field_data_field_sponsor_logo';
$handler->display->display_options['fields']['field_sponsor_logo']['field'] = 'field_sponsor_logo';
$handler->display->display_options['fields']['field_sponsor_logo']['label'] = '';
$handler->display->display_options['fields']['field_sponsor_logo']['alter']['make_link'] = TRUE;
$handler->display->display_options['fields']['field_sponsor_logo']['alter']['path'] = '[field_sponsor_website]';
$handler->display->display_options['fields']['field_sponsor_logo']['alter']['external'] = TRUE;
$handler->display->display_options['fields']['field_sponsor_logo']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_sponsor_logo']['click_sort_column'] = 'fid';
$handler->display->display_options['fields']['field_sponsor_logo']['type'] = 'file_rendered';
$handler->display->display_options['fields']['field_sponsor_logo']['settings'] = array(
'file_view_mode' => 'sponsorbox',
);
/* Sorteercriterium: Inhoud: Datum van inzending */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Filtercriterium: Inhoud: Gepubliceerd */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filtercriterium: Inhoud: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'sponsor' => 'sponsor',
);
/* Display: Inhoudpaneel */
$handler = $view->new_display('panel_pane', 'Inhoudpaneel', 'panel_pane_1');
/* Display: SponsorBox */
$handler = $view->new_display('block', 'SponsorBox', 'block_1');
$translatables['sponsor_caroussel'] = array(
t('Master'),
t('meer'),
t('Toepassen'),
t('Opnieuw instellen'),
t('Sorteer op'),
t('Oplopend'),
t('Aflopend'),
t('Inhoudpaneel'),
t('View panes'),
t('SponsorBox'),
);
Comments
Comment #1
parijke CreditAttribution: parijke commentedIt appears the link rewrite is not working with an rendered file. I changed the fieldtype to image, used that and the link works like a charm.
I think it is a combination of media 2.x and views_slideshow?
Any suggestions how to deal with this in the (near) future?
Comment #2
denix CreditAttribution: denix commentedI have the same problem but with a simple view pointing to a photogallery. so I think is a combination of media 2.x "rendered image" and views (rewrite as link).
The only solution I found is to create a content type "Photo" containing File, Caption and Copyright and the URL I want to point to, then do a view of Photos and not of Medias.(does not work either)Hope this help
Comment #3
parijke CreditAttribution: parijke commentedHi Denix,
I used the same workaround. I think we should address this in de media 2.x issuelog as well.
[EDIT]
After searching I found it is File Entity related. So this one can be closed here...
http://drupal.stackexchange.com/questions/51481/wrapping-a-rendered-file...
I am going to try this one...
https://drupal.org/project/linked_field
Comment #4
parijke CreditAttribution: parijke commentedIt is a File Entity issue, not views_slideshow
Comment #5
Alauddin CreditAttribution: Alauddin commentedUpgraded to Media 2x and File Entity 2x version and ran into this issue in views rewrite.
this module works
https://drupal.org/project/file_entity_link
Just enable, and then visit admin/structure/file-types
in Manage File Displays > select
Link options
x Link file to referencing entity