I am trying to how to provide an option to either upload an image in a post OR provide a direct link to image.
I am creating a directory of websites. Some websites in their Terms of Service do not permit downloading of any of their images then uploading onto a different server. Instead, they may allow linking to that image. Therefore, in filling out the fields in the post for my directory, want to provide both options but only 1 or the other, not both.
1) How?
2) Do you know of a similar directory already created so that I am not reinventing the wheel?
Thanks.
One very simple way is to paste the URL of a valid image into the Types Image Field (with which you can also upload)
It will display it if existing, it's just an image tag calling an image stored somewhere.
If you need more control, I would create 3 Fields, an Image Field and a simple URL or even just a single line field, and a Radio or Checkbox Field, which allows you later to decide "URL or Image?"
Then apply a Condition where you create the Fields in Types, which listens to the Checkbox or Radio field and displays each (Image or Single Line) field depending on it's set value.
So later, when editing a post or with a Toolset form, you can choose "Image or URL?", and that will show either Image Upload Field or single line URL to be populated.
Later you can check with HTML conditions what is provided and display either field on the posts.
However, usually (if the image URL is valid) just pasting it into the field and saving works just like uploading an image.