Skip to content

Instantly share code, notes, and snippets.

@mkorostoff
Created May 28, 2014 14:57
Show Gist options
  • Save mkorostoff/7838ee9c36848453238b to your computer and use it in GitHub Desktop.
Save mkorostoff/7838ee9c36848453238b to your computer and use it in GitHub Desktop.
diff --git a/docroot/profiles/nbcsports/modules/custom/views_rss_gfc/views_rss_gfc.field.inc b/docroot/profiles/nbcsports/modules/custom/views_rss_gfc/views_rss_gfc.field.inc
index a17bd53..f11c97f 100755
--- a/docroot/profiles/nbcsports/modules/custom/views_rss_gfc/views_rss_gfc.field.inc
+++ b/docroot/profiles/nbcsports/modules/custom/views_rss_gfc/views_rss_gfc.field.inc
@@ -270,6 +270,8 @@ function views_rss_gfc_field_formatter_view($entity_type, $entity, $field, $inst
if(array_key_exists($langcode, $field_collection->field_gallery_item_asset)) {
$image = $field_collection->field_gallery_item_asset[$langcode][0];
$uri = file_create_url($image['uri']);
+ $small_url = preg_replace('/files/', 'files/styles/mystyle/public', $uri);
+ $tablet_url = preg_replace('/files/', 'files/styles/mystyle2/public', $uri);
// XML element array in format_xml_elements() format.
$rss_element = array(
'key' => 'media:content',
@@ -304,6 +306,20 @@ function views_rss_gfc_field_formatter_view($entity_type, $entity, $field, $inst
),
'value' => url('node/'.$entity->nid, array('absolute' => TRUE)).'#slide-'.(1+$delta),
),
+ array(
+ 'key' => 'media:smallURL',
+ 'attributes' => array(
+ 'type' => 'html',
+ ),
+ 'value' => $small_url,
+ ),
+ array(
+ 'key' => 'media:tabletURL',
+ 'attributes' => array(
+ 'type' => 'html',
+ ),
+ 'value' => $tablet_url,
+ ),
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment