[SOLVED] Does Media create thumbnails that can be exposed in Views, for making a grid of thumbnails with certain tag, linking to original images?

Events happening in the community are now at Drupal community events on www.drupal.org.
therobyouknow's picture

I would like to use Views to display, in a block, real thumbnails of images uploaded using tools based on the Drupal 7 Media Gallery module in a grid of images with a certain tag (using filter in views).

By real thumbnails, I mean either cropped small images of the original or the entire original reduced in size. This kind of thumbnail is efficient at loading. I do not want thumbnails which are simply the browser's on-the-fly scaling down of the original.

Comments

Use image styles

pbuyle's picture

Drupal core provies a Image Styles which can be used to generate thumbnail from images, see http://drupal.org/documentation/modules/image#styles. When displaying a File or Image field, views can use an image style. For a Media field, you can configure views to use a view mode where an image style is used when displaying the file.

therobyouknow's picture

@mongolito404 - Where in Views do I switch on image style for Gallery Media?

Some sub-questions to help answer the above question:
- when deciding on the field to use in Views to display the image, which data type should I choose from the available options?
- I want one that will allow me to filter on tags from a taxonomy? "File: Path" field type does it but not sure if this can be transformed using the image style that you suggest (hope it would) (?)
- I created View with File:Path by starting off by using Show: Files on the initial views creation page ( admin/structure/views/add ) Should I instead create a view with Show: Content and then on the next page, admin/structure/views/view/mynewview
add field Content: Gallery media to display the image and then apply the image styling for thumbnail somehow within the view settings?

(Please advise) Thanks for far...

(Edit: rewrote my response to clearer)

progress so far... (selecting images ok i think...)

therobyouknow's picture

still need to figure out thumbnails but done the other things of showing images belonging to a tag... to do this:

to display media images / images from the media gallery (acquia media module), I needed to add a tags text field to the gallery itself - this is not done as default

edit galleries adding tags as required

create a view
- add field content nid and content: gallery media

in content: gallery media field:

check 'rewrite results' in' configure field' for 'gallery media field', check 'output field as view' link, add url something like the following, play around with it until you get the page you want
EDIT: not: media-gallery/lightbox/[nid]/[media_gallery_media-fid] (as mentioned earlier) BUT instead: media-gallery/detail/[nid]/[media_gallery_media-fid] - this will link direct to the image with download options and also show the link to the gallery that the image belongs to.

add filter in views
content type = gallery
content has taxonomy term (=art)

all this will give you images (not yet thumbnailed) of a certain category, each image linking to its full size

still need to figure out thumbnails

progress part 2: thumbnail images as grid!

therobyouknow's picture

Thumbnail:
@mongolito404 thanks for the hint about media in configuration section, this gave some clues:

here's more to my self-answered cookbook:

To get the grid working for series of images:
Apart from selecting the Grid for formatting, the other thing is to edit the settings in the Content: Gallery Media field too.

When editing a view field, in "MULTIPLE FIELD SETTINGS", uncheck yes uncheck!: Display all values in the same row.

This makes the grid work.

Small square thumbnails effect:
This is achieved in 2 parts of drupal
1) in the Media section of admin/config/media/
2) same edit field view for Content: Gallery Media

detail:
1) I added a new image style, small_square_thumbnail in admin/config/media/image-styles 90x90 crop and scale
then over to admin/config/media/file-types/manage/image/display (Don't forget to Save it, otherwise it won't be visible for elsewhere you need to use it)
- the image style small_square_thumbnail I created needs to be assigned to a display type for the Media Type Image. I chose to assign it to the pre-defined Small, which was by default not active. I click on the button 'Small' in admin/config/media/file-types/manage/image/display and make it Visible. Don't forget to Save. Then in the Display settings for Small (admin/config/media/file-types/manage/image/file-display/media_small) I assign my Image style small_square_thumbnail. Click save!

2) Back to the View. Edit field Content: Gallery Media. See the Formatter drop down, select Media. File View Mode: select Small. Save!

Now I need to get this on the front page for galleries of different tags. I've started using Panels (and maybe Panels within Panels via mini Panels to get >3 columns).

But I've got pretty much what I wanted. Thanks for indicating it was possible - that's all I need to know to put in the effort.

My site is an export of free Drupal Gardens site

therobyouknow's picture

Bear that in mind that was my starting point, my site is an export of free Drupal Gardens site (drupalgardens.com).

therobyouknow's picture

media-gallery/detail/[nid]/[media_gallery_media-fid]

therobyouknow

alltooeasy's picture

Been trying to do just this inside Drupal Gardens.

In short I'm not sure its possible to do whilst still hosted on Drupal Gardens. Can you confirm this.

Looked at a variety of options, but it seems that media (i.e. - an image) uploaded to a media gallery in Drupal Gardens cannot then be tagged/have an associated taxonomy term added to it and displayed independently of the media gallery it belongs to.

Thanks for the write-up. I've since downloaded the relevant files from Drupal Gardens, but sill frustrating to not be able to achieve this in Drupal Gardens itself.

It seems like its a recognised issue, is there a means to see the tracking and reporting of this inside Drupal Gardens?

Thanks!

John

It should be possible...

therobyouknow's picture

John it should be possible in Drupal Gardens because everything is being done within Drupal admin and views.

Yes, individual media, i.e. a single uploaded image/photograph can be tagged, this is asked for it the upload screen. This is provided for images by default.

It should be possible to display images independently of their galleries, based on the tag(s) associated with the image. In the filter section of the view on the left hand side choose Gallery Media and filter on tag. See if that works...

I will try to recreate it in Gardens when I get time.

thanks

alltooeasy's picture

Cheers!

I had a response from d.g support team. Will post back here soon.
Haven't tested it yet, but the solution has been used on a production site for a commercial d.g. client apparently, so is possible and seems broadly inline with your suggested solution.

Not got access to a pc at the mo. Will try and post ASAP.

Thnx for the reply. Once again the d.o. community pours forth! Iou a beer for sure!

Relationship

flugga's picture

Adding tags to the gallery isn't actually necessary. I set-up a view that uses the file ID (Content: Gallery media:fid) relationship to filter by tags.

Media

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: