Jump to content


Photo

Adding Images to a Repeater Element


  • Please log in to reply
6 replies to this topic

#1 porl

porl

    Jr. Member

  • Members
  • PipPip
  • 46 posts
  • 17

Posted 04 June 2012 - 10:00 PM

Hi guys

Just a quick question.
When adding an image to an image field inside a repeater, the image gets added to an invisible page (/processwire/repeaters/forfield......).

I understand why this is done, but if there is another field (a text block in this case for an article 'body') in the same repeater element the 'insert image' button cannot find it (it defaults to listing images associated with the page rather than the repeater element).

Is there an easy way to allow simple insertion of images into blocks within a repeater element?
Thanks

#2 Soma

Soma

    Hero Member

  • Moderators
  • 3,188 posts
  • 1745

  • LocationSH, Switzerland

Posted 05 June 2012 - 01:42 AM

This "bug" has already been reported by me in the repeater thread, though nobody seems to recognized or understand it.

Thx for bringing this up

@somartist | modules created | support me, flattr my work flattr.com


#3 porl

porl

    Jr. Member

  • Members
  • PipPip
  • 46 posts
  • 17

Posted 05 June 2012 - 06:25 AM

I guess I could work around it for now with a "page wide" images field at the end of the repeaters, but it would be nice to have some sort of separation between elements.

#4 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,525 posts
  • 851

  • LocationVihti, Finland

Posted 05 June 2012 - 08:26 AM

Soma & porl: what would be best way to handle this in your opinion? I can think few quite a different options how this can be fixed.

#5 porl

porl

    Jr. Member

  • Members
  • PipPip
  • 46 posts
  • 17

Posted 05 June 2012 - 10:06 PM

Not entirely sure, but when I first tested the image field etc in a repeater I expected the tinymce image button to display images from that by default. The second thing I expected was that the images added to these embedded image fields would be browsable from the image button's dialog.

Not to say the current behaviour is 'wrong', just not what I expected. Perhaps making it easier to find images from repeater fields when browsing in the image window would be the primary thing, but the default behaviour to me should be to show images in the related area first and then perhaps an 'other images on this page' option in the dialog.

Sorry I'm not wording this very well, my brain seems to have gone for a walk.

#6 Michael Murphy

Michael Murphy

    Distinguished Member

  • Members
  • PipPipPip
  • 92 posts
  • 53

  • LocationBasel, Switzerland

Posted 22 October 2012 - 06:07 AM

I also ran into this problem today. There does not seem to be any way to access a file or image from the TinyMCE insert file / image dialog when using a repeater. The only way to get around this issue is to add a file or image field to the main page (outside of the repeater).


I would say the expected behaviour would be to first look for file / image fields within the repeater, then look for files / images outside the repeater (the main page). I am not sure you would ever want to access files / images from another repeater row.

Should we add this as an issue to Github?

#7 ryan

ryan

    Hero Member

  • Administrators
  • 5,773 posts
  • 3116

  • LocationAtlanta, GA

Posted 22 October 2012 - 11:59 AM

I have gone ahead and added this capability to the dev branch. Now pages with repeaters can access images within the repeaters, and repeater pages can access images from their containing pages.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users