Skip Navigation

[Resolved] Create form to add img

This support ticket is created 5 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 5 replies, has 2 voices.

Last updated by Shane 5 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1229619

Hi!

>>Tell us what you are trying to do?
I have a custom post type "product". I would like to give users the opportunity to add their own photos. Can you tell me what is better:
1) Post type "product" and second post type "img" and relationship one to many. Next Form module (img) for users.
2) Post type "product" with field "img". The question is - can I create form only for one field?

Is there any documentation that you are following?
No.

Is there a similar example that we can see?
I don't know 🙂

What is the link to your site?
hidden link

#1229643

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jace,

Thank you for contacting our support forum.

I would recommend the use of the "Product" post type with the image custom field. It is possible to have a form with only the image field, however the posts will be created with an auto draft title.

You can just let the title field remain so that the user can at least add a title for the image.

Thanks,
Shane

#1230064

To be clear. I have an existing type created by mine. A user can add only the image field.

Can you tell me how to create for where a user can add only one field to an existing product?

#1230083

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jacek,

I'm not sure i'm understanding correctly. I was under the impression that the user will be creating the products through the form.

"Can you tell me how to create for where a user can add only one field to an existing product?"

So essentially you want to create an edit form but only allow them to upload an image to that specific product correct?

In this case all that is needed is for you to create the edit form and just remove everything else from the form except the image.

Another question is it that A single product can have multiple images uploaded by different users ? Please let me know this as soon as possible so that I can best advise.

Thanks,
Shane

#1230095

>>So essentially you want to create an edit form but only allow them to upload an image to that specific product correct?

Yes!

Another question is it that A single product can have multiple images uploaded by different users ?

Yes.

#1230120

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jacek,

Then in this case it would be best if we used a post relationship, One to Many 🙂

I was under the impression that a user will create the products.

So all you need to do is create the relationship between the Products CPT and the Photos (lets call it that) CPT in a one to many relationship.

Then all you need to do is create a custom field for the image and add it to the Photos CPT. Finally just create the Add New Form for Photos and just remove all the fields except the Parent field that will allow the user to set which Product this photo is to be attached to.

Please let me know if this is clear.

Thanks,
Shane