Jump to content

Images In Repeaters


Gazley
 Share

Recommended Posts

Hi there,

I have a repeater field that contains an image field. I tried to add an image into some body copy using the image link in the TinyMCE text area, but PW couldn't actually see any images in the page. It would appear that it doesn't look inside repeaters.

Does this sound about right?

Thanks!

Link to comment
Share on other sites

Images are tied to a page and repeaters are essentially special hidden pages, so I think that's expected in this case.

Can I ask what the usage is in this case? It's just that for most pages you wouldn't have image fields inside repeaters in order to use images in the main page's body text - an image field attached to the main page could store as many images as you like to insert into the body text.

If you let us know the fields in your page and the fields in the repeater we could possibly suggest some other ways of achieving what you're trying to do :)

Link to comment
Share on other sites

Hi Pete,

I embedded the image field inside the repeater along with a multi-select dropdown affair. This was so that I could categorise images in terms of their usage. For example, one image in a collection might be considered the "Teaser" image that is used by the system in summaries leading to a main details page. Other images might be only for use in a Carousel and their sizes are matched accordingly. Other images might be categorised as "Gallery" meaning that they could be queried for use in a sequential gallery on the page.

Other than that, given the minimal amount of meta-data capable field on the standard image fieldtype, I would have to have more than one image field, named appropriately, in any given page. The latter isn't totally unacceptable but it seems natural to me to require to attach meta-data to each image.

If you can suggest other approaches, I'd be very interested to hear them.

Thanks.

Link to comment
Share on other sites

Just thinkin'

Make an "image" template put text fields for metadata in it ( as much as needed ) and a image field, that allow only 1 image.

Then make a "category" template with a field of type Page ( multiple ).

Then make for each category a page with template "category" and select the pages "images" you wat to be categorized.

edit: a page could be a page, but you can use it to store data to.

Link to comment
Share on other sites

The main issue with some of the solutions I've thought about is just the general difficulty of querying.

I think it's all about the user who manages the site. If I build a little site for my self, I wouldn't use a CMS at all. I will build a little controller, thats all. But on normal circumstances other people fill the site and it should be as obvious as possible. (no explanation needed) So If that wil give performance issues, I think I'll go for the cache and the remarkable MarkupCache module.

Link to comment
Share on other sites

And why you also want them to insert in the page body tinymce text? You could still use a "textimages" field or so underneath the tinmyce field so image could be uploaded there if really needed.

Sounds from other posts, like you're trying to bend things a little while having all possible (queries, categories, repeaters) that is currently not there and repeaters are maybe an good option to be able to query them. I wouldn't consider repeaters designed for that use, but surely works (apart from not being accessible in a outside repeater text field or from other pages.

Depends a little on what exactly we're dealing with here. Products catalogue, news articles, common content/infos? If it where really about meta infos and something like gettyimages, the one image as a page together with meta infos as much as needed would be the way to go. If for articles or news I would consider just using a images field for each category (summary, gallery, details) and upload them separate in a dedicated field. Maybe tradeoff reusablity some for easy, straight forward setup. I would consider giving function meaning by using many images fields, rather than a category select. Especially as in your case the category is "function" and not real meta info.

Maybe it can be even mixed with some centralized image content that are pages with collections of images and you can add them to any page through page select field.

I would carefully think it out what really matters.

Also creatiing a new extended image field that has a pagefield might a good solution too. Works surely better for single image fields as it would for multiple, but in both cases you will always have to set the "category" everytime you replace or upload a new image.

There's really a lot that can be considered regarding image management, but I never felt I needed more than there is. Not saying there could be more options for special cases in a image default field. Still maybe a module would be the way to go to give a needed functionality rather than using something that will may limit you later on.

  • Like 1
Link to comment
Share on other sites

>And why you also want them to insert in the page body tinymce text?

Sorry, I don't understand what you mean.

>Sounds from other posts, like you're trying to bend things a little while having all possible

I'm not trying to bend anything. I'm simply trying to figure out how things work and how I can use what's already there to solve my issues. I generally ask "what is best practice" so I don't go off down the wrong track.

Maybe I'm just a bit thick.

Link to comment
Share on other sites

>And why you also want them to insert in the page body tinymce text?

Sorry, I don't understand what you mean.

Sorry, I was assuming, as you questioned not being able to do so, that you needed to do so.

I'm not trying to bend anything. I'm simply trying to figure out how things work and how I can use what's already there to solve my issues. I generally ask "what is best practice" so I don't go off down the wrong track.

Maybe I'm just a bit thick.

No that's cool I just misinterpreted what you were saying.

One thing comes to mind, sometimes also knowing exactly what thing you're building, will often help finding alternative ways, maybe finding even better solutions. But if you're trying things out to see what's possible and where the limits are that's ok.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...