Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Galleria currently looks at the html inside of an html selector to extract the data it needs to create a slideshow. A far better way is to feed the gallery via a JSON array.
I'll post a patch shortly.
Comment | File | Size | Author |
---|---|---|---|
#12 | galleria-json_slides-1923148-12.patch | 15.22 KB | acrollet |
#7 | modules.png | 187.97 KB | jamesbenison |
#7 | image-file-entity-fields.png | 99.26 KB | jamesbenison |
#7 | add-file-field.png | 93.55 KB | jamesbenison |
#7 | file-media-selector-settings.png | 117.52 KB | jamesbenison |
Comments
Comment #1
jamesbenison CreditAttribution: jamesbenison commentedHere's a patch.
Basically this makes it possible to use youtube (via media youtube module) vimeo (via media vimeo module) and images with imagefield and media.
Comment #2
miro_dietikerWhile this sounds interesting, note that now the galleria content has no html representation for e.g. search engines.
If we want to keep with that fallback, we should still add the output to the system and hide it...
Comment #3
jamesbenison CreditAttribution: jamesbenison commentedI'm sticking this patch up because it fixes some undefined index issues that showed up with the above patch. And FYI the patch was tested with the latest dev versions of file_entity and media.
As for the html representation, the technique I used was to set the dataSource option for a data array created in the theme function. Basically it's like you see here. By setting this it overrides any html inside the galleria selector and hides it. I took out the html in part because it causes a flash of unformatted content (FOUC) on page load, and it's extra code that slows down rendering.
Should we make the adding the html a menu option?
As an aside, the patch has the array keys for the galleria layers and links, but they're commented out. It would be nice to get some input on how to best add these. I was thinking maybe we could add a link field and a textarea to file entities.
Comment #4
jamesbenison CreditAttribution: jamesbenison commentedI've made a more comprehensive patch that adds support for all these things and corrects my redundancies in the title/alt support.
Also changing this thread title to something that makes a bit more sense.
Comment #5
jamesbenison CreditAttribution: jamesbenison commentedThis latest one keeps the image html for search engines and fixes views field mapping.
Please test and give feedback.
Comment #6
TimTheEnchanter CreditAttribution: TimTheEnchanter commented#5 worked for me. I was able to load youtube videos in via media_youtube module. Thanks for the patch!
Comment #7
jamesbenison CreditAttribution: jamesbenison commentedPeople are still reporting on similar issues. I'll clarify how to use the patch above to get these features working with the media module.
You'll need the latest galleria dev with the patch in #5 applied. Plus add media, file_entity, media_youtube, media_vimeo, and the link module. Note the versions I used in the screenshot.
Add fields to your image file entity (screenshot).
Add a content type with a file (not image) field and the media file selector widget (screenshot). Set up the field settings to allow image file types (with jpg, png extensions) plus video youtube and vimeo (screenshot).
On manage display, choose galleria and map the fields from your image file entity for title, description, layer, and link (screenshot).
Add images (screenshot), youtube (screenshot), and/or vimeo (screenshot).
Working galleria:
-Image slide with html layer and slide linked to drupal
-YouTube
-Vimeo
The views integration should also be working.
I'll go through and mark similar issues in the queue as duplicates.
Comment #8
thinkdrupal CreditAttribution: thinkdrupal commentedPatch #5 is missing the fix on 'galleria-container.tpl.php' that is in patch #4.
I also had to make a change to the 'datasource'.... in the patch
// Add "data" array to galleria option "dataSource"
//$optionset->options['dataSource'] = $data;
$optionset['options']['dataSource'] = $data;
Comment #9
klavs CreditAttribution: klavs commentedwhy only allow field type of type file - and not image as well ? (I have a lot of nodes - with a field type of image - that I'd not like to have to alter all of them :(
Comment #10
klavs CreditAttribution: klavs commentedAnyone have it working with views?
I tried patch in #5 + additions from #8.
I don't see any layer_field (or link select_field) options (under galleria settings - or on the file field settings) - and upon display of the view,I only get a lot of errors:
Notice: Undefined property: stdClass::$uri in theme_file_link() (line 727 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in theme_file_icon() (line 765 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 809 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_map() (line 852 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in theme_file_link() (line 734 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filesize in theme_file_link() (line 734 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filename in theme_file_link() (line 740 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$uri in theme_file_link() (line 727 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in theme_file_icon() (line 765 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 809 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_map() (line 852 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in theme_file_link() (line 734 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filesize in theme_file_link() (line 734 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filename in theme_file_link() (line 740 of .../modules/file/file.module).
Notice: Undefined index: und in theme_views_view_galleria() (line 165 of .../sites/all/modules/galleria/theme/theme.inc).
Notice: Undefined property: stdClass::$uri in theme_file_link() (line 727 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in theme_file_icon() (line 765 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 809 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_map() (line 852 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in theme_file_link() (line 734 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filesize in theme_file_link() (line 734 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filename in theme_file_link() (line 740 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$uri in theme_file_link() (line 727 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in theme_file_icon() (line 765 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 809 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_map() (line 852 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in file_icon_path() (line 824 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filemime in theme_file_link() (line 734 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filesize in theme_file_link() (line 734 of .../modules/file/file.module).
Notice: Undefined property: stdClass::$filename in theme_file_link() (line 740 of .../modules/file/file.module).
Notice: Undefined index: und in theme_views_view_galleria() (line 165 of .../sites/all/modules/galleria/theme/theme.inc).
Comment #11
klavs CreditAttribution: klavs commentedOther modules, using the file module, have had similar errors ( http://drupal.org/node/845848 ) - and there it was a missing call to field_attach_submit.. but where that belongs in views.. plugin.inc - I have no idea :(
Comment #12
acrollet CreditAttribution: acrollet commenteduploading a patch that rolls in the template change as noted in #8 - I could not reproduce the issue with the optionset object, so have not incorporated the change. Attached patch works for me.
Comment #13
byue CreditAttribution: byue commentedHello All:
I have made some changes on the codes, don't know if it is correct. This is to have YouTube preview thumbnail to render with "thumb" imagestyle settings.
elseif ($item['type'] == 'video') {
$data[$delta] = array(
'video' => file_create_url($item['uri']),
'title' => $item['filename'],
);
// Load the YouTube file
$video_file_load = file_load($item['fid']);
// Set up the settings array with your image style
$display['settings'] = array('image_style' => $optionset->imagestyle_thumb);
// Get the render array for the thumbnail image
$youtube_thumb_image = media_youtube_file_formatter_image_view($video_file_load , $display, LANGUAGE_NONE);
// Get the path of the image file of the youtube thumbnail and apply imagestyles
if (empty($optionset->imagestyle_thumb)) {
$data[$delta]['thumb'] = file_create_url($youtube_thumb_image['#path']);
}
else {
$data[$delta]['thumb'] = image_style_url($optionset->imagestyle_thumb, $youtube_thumb_image['#path']);
}
}
It works on well for me as I only use media-youtube. Also the size of the YouTube video should also render at a dimension that is the same as the "full" imagestyle settings, but that's beyond my knowledge.....
Cheers,
byue
Comment #14
Begun CreditAttribution: Begun commentedI just followed these instructions and wanted to provide the following feedback: