5

Heyo - I have an entry form in which you select/upload assets (photos). The asset has a caption/copyright (custom)field attached to it, so ideally I'd tell them…

  1. Click "Add Asset" and upload/select your photos
  2. When the pills show up in the entry form, double-click them to add captions/copyright

But, I find that if you do the above, you won't see the caption/copyright field (just title and file name) unless you save the entry between steps one and two.

Before saving…

After saving…

I can see why this could be … the images are probably in a holding position until you save the entry(?). But just wondering if someone can confirm I'm not mucking something up, or maybe has a workaround?

It seems weird to have a note on the entry form that says "Reminder: 'Save and Continue Editing' to add captions to the images.

Same issue also comes up when you need to upload assets in a field, then in a subsequent field choose one of the assets (say, an entry form where you upload a group of images, then want to select one of the images to be the group's thumbnail).

Any ideas? Tks in advance.

  • Just tested it, but I can't confirm that behavior, alsophil. I see the fields straight away after upload (via form or drag and drop). – carlcs Jul 31 '14 at 15:08
  • 1
    Hmn. I wonder if this has to do with using {slug} in the default upload location? My hope was to base asset folder names on entry slugs to make housekeeping is a bit easier, but I can see where that might be causing problems. Off to test… – philzelnar Jul 31 '14 at 15:16
  • Yep, the problem was dynamically generating the asset path using {slug}. I feel foolish for not checking that sooner. – philzelnar Jul 31 '14 at 15:22
  • 3
    Hey @alsophil, welcome to the Craft CMS Stack Exchange! I resurrected your question and would encourage you to provide and accept your answer so your troubleshooting might help someone else. You did some great work here, so it'd be a shame to see it disappear. – Matt Stein Jul 31 '14 at 16:55
3

So, thanks to @carlcs for verifying it was my setup…

turns out I had set the asset's Default Upload Location to include the slug (i.e. /photography/{slug}) and restricted uploads to that folder. This way images would end up in a folder whose name matched the entry slug, making it easier to clean out unused assets from time-to-time.

But that approach was the source of the problem. Once I removed {slug} from the default upload location it all worked as expected, the caption field appeared immediately after adding the asset.

Of course, in retrospect this makes total sense — there's no {slug} until you save the entry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.