3
votes

Working on a project for a client. They have a PDF that has been broken into separate pages as images, and they want to have each of those images appear on a single page - at least 40 images for this one page alone.

So far, I've just been placing them individually. Each time you go to place an image using the rich editor, you start at the media root - and the way the media library has been structured, these images are buried very deep within subfolders. So it takes about 20 seconds of clicking, scrolling, and reading to find each image to place it.

These images are sequential and placed in order in the media library. Is there a way I can select a group of images and just drop them in? There are going to be literally hundreds of these, and it's a huge waste of my (and my client's) time placing images one-by-one.

3

3 Answers

5
votes

Going along the lines of what TwentyGotoTen has said, I would:

  • Structure your images in the Media Library within folders (if you haven't already done so)
  • Create a sublayout/xsl rendering that contains a repeater to render the images
  • Add the control to the layout and set the DataSource of that control to the Media Folder
  • The code should then retrieve all child items from that folder and render as necessary.

You may need the use of the Sublayout Parameter Helper to access the datasource from ascx codebehind.

2
votes

I'm assuming you just want the images to appear one after the other with nothing else inbetween. Rather than embedding images in rich-text perhaps you should consider creating a multilist field for the images in the template and create a rendering / sublayout to render them.

You can set a more suitable source for the multilist than the media root. This should make it a lot easier to select the images.

1
votes

Mark van Aalst has created a custom image field that allows to do this a bit easier as well.

Have a read through this.
This is also available on Sitecore's Marketplace: Multiple Images Selector

It will allow you to select your images through a multilist field, but it'll show the images as an image field with multiple images.

I think this is pretty much the solution TwentyGotoTen is talking about as well, but shows the thumbnail of the selected images as well.