Jump to content

Image field: selection of already uploaded images possible?


Webrocker
 Share

Recommended Posts

Hi,

I have a simple content structure like this:

- A page

  -- title

  -- content (repeater field)

     --- headline

     --- body

     --- images (image field)

  -- (…)

- Another page

   (...)

Is it possible to not only upload images via the "image" field, but let it select already uploaded images (in other "content" repeaters or on other pages)? (Kind of how the image thing inside the wysiwyg works - I don't want to have the image selection inside the "body" field and disabled the image option in the wysiwyg editior setting).

Or do I need to introduce a new field alongside the regular mage field?

The actual scenario is like this:

With the above structure, the editor created three content sections on one page a, b, c. In each section, he uploaded one image.

After a whle he decided that the section c is in fact part of section b, and deletes it, after appending it's "body" content to section b's body field. Because now the text of section c is in section b, he also wants to have section c's image go along with section b and the image there - but the image field  seems to only offer a new upload of the image - or am I missing something?

thanks,
Tom

Link to comment
Share on other sites

I have never used images in repeaters that way, but I would assume that in this case, image fields are associated with a repeater panel just as they are usually associated with a page in PW. That means if you delete the repeater panel, you also delete the image along with it.

If I understand your scenario correctly, that would mean that the editor would want to switch the associated image for the exisiting section, meaning he'd have to upload it again as the new image for the existing section. That is unless your image field allows uploading multiple images (which is a setting for image fields).

Link to comment
Share on other sites

Thanks for the fast replies (this community rocks) :-)

"my" image field allows for multiple images. It is possible to (re)upload the "c" image in "b", appending it to b's images.

I understand that repeaters internally are nothing but pages, so if PW ties images to pages, they are tied to the repeater context, ok. I'm wondering,though; the image option in the wysywig is able to browse through images already uploaded, even on other pages, so there seems to be a way to get to the already uploaded images.
The concept of a central image repo and page selector sound interesting, I'll look into that.
For the current smallish site, I'll stick with re-uploading the image.

I have never used images in repeaters that way, but

Out of curiosity, how would you handle text/image content on a page if there can/may be one or more of these sections? Hidden subpages, collected on the parent page? I'm still in the baby steps mode, so any nudge in a more proven direction is welcome :-)

Thanks again for the support.

  • Like 1
Link to comment
Share on other sites

Out of curiosity, how would you handle text/image content on a page if there can/may be one or more of these sections? Hidden subpages, collected on the parent page? I'm still in the baby steps mode, so any nudge in a more proven direction is welcome :-)

It really depends on the site concept. Using pages for these subsections might offer more flexibility, repeaters might be simpler for editors. (I'm not opposed to using repeaters that way, I just haven't used them that way myself – yet.)

I know the whole “there's more than one way to do what you want to do” approach in PW can be confusing when you first get started. Then again, it does offer a great flexibility to react to individual site concepts and user needs. There almost always is more than one way, just pick the one that you feel works best in any given scenario.  :)

  • Like 1
Link to comment
Share on other sites

I think the main "click" you need in your head is understanding the concept. Everything is a page with fields. See it as data container.

  • You need to reuse pages or their fields? Put them somewhere hidden and reference them where needed. 
  • You need some kind of repetition of content? Use repeaters or sub pages. Or take a look at this differentiation from our master: Comparison of Repeaters, PageTables etc.

The only thing ProcessWire cannot do (yet): A kind of repeater where you can define the kind of content block you insert (like TYPO3 or Contao does). But also this can be done with a clever combination of repeaters and PageTables and... whatever. There always is one or more ways ;)

  • Like 1
Link to comment
Share on other sites

Yes, kind of. But then you get a row of a PageTable which isn't the same (of course) as a individual repeater template, whose layout you can control. The other systems (I've been told, don't know actually, would never cheat on PW) allow a more visual approach than just a row of different data fields.

Link to comment
Share on other sites

Can't remember my test two weeks ago. But it isn't inpage, is it? It's more a usual page layout in a lightbox, right? What I have in mind (and others, too) is an integrated repeater-like way with choosable layouts. But honestly: This is no deal breaker, but it is something (perhaps the only thing) PW can't do out of the box.

Link to comment
Share on other sites

Yes in modal. And its superior to other block style as every block is a page and can be published or unpublished etc and all multilang. I don't need visual inpage editing as much as a solid block type. Also you can (I do anyway) make all easy editable when viewing page.

Link to comment
Share on other sites

I totally agree. It's not even my own wish, but I hear it more often in the past year since more and more people are considering PW as an alternative. I think such a feature would be a good reason for CMS switchers and/or a good marketing thing. You know, like "look  how flexible it is, you can build your page even in the backend very individual with drag&drop and eye candy and such stuff... blah blah" ;-)

PageTable is great, repeaters are great, all the new pro fields and of course all your modules are great. The flexibility is endless. You know that, I know that, every experienced PW user knows that. But - as I said - for marketing reasons such at a first glance flexible features or on the other hand the learned and for several years used solutions like a central media manager would be nice. They could be built on top of the PW core without losing the PW paradigms. People are not interested in how something works as long as it works for them :-)

  • Like 2
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

×
×
  • Create New...