Skip Navigation

[Resolved] How to create an artist gallery site with attributes for each image uploaded

This thread is resolved. Here is a description of the problem and solution.

Problem: I am creating an Artist directory and gallery site that provides artists the ability to upload their own artwork images. I have created a Form that allows artists to upload multiple images into a repeating image field. I would like to give artists the ability to apply taxonomy terms to each image in the custom field.

Solution: It is not possible to apply terms to each image uploaded in a repeating custom image field. If you need the ability to add taxonomy terms, you probably need a separate custom post type. Artists can then use Forms to create a new post for each "Artwork", and apply taxonomy terms as needed to that post.

This support ticket is created 3 years, 2 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#1912617

Hi,

I would like to have a front end form where "artists" (post type) will be able to upload and edit their own profile picture, bio, and a gallery of images. That part I know how to do.

What I need help with is that I would like each image to be tagged with attributes or categories or something that allows me to then create a template that only shows a certain category (or tag?) of image.

For instance:
mypainting.jpg (image) + topic (flowers) + medium (acrylic)

I would then be able to create a template that shows, for each artist, all acrylic paintings only; or for each artist, all flower paintings only; or for each artists, only acrylic flower paintings.

So, in essence, I need them to be able to upload multiple complex records. Is that doable?

Thanks,
Lisa

#1912645

Hello, it sounds like you have an Artist post type and you've added a repeating image custom field in that post type. However, it's not generally possible to add taxonomy terms or custom fields to each image in a custom field. It sounds like you probably need another custom post type in this case, something like Artwork, that contains a single image custom field or uses the built-in WordPress featured image field to store the uploaded image. In other words, each image would be stored in a separate Artwork post, rather than all images stored in the Artist post's repeating custom field.

It also sounds like you might need at least two custom taxonomies to group these Artwork posts. You could create a custom taxonomy "Medium" where you have terms like Acrylic, Watercolor, Charcoal, etc., and you could create another custom taxonomy "Topic" where you have terms like "Flowers", "Landscapes", "Portraits", etc.

When artists create new Artwork posts, they will select the taxonomy terms they want to associate with each Artwork post. Does this all make sense? Can I get your feedback about using custom post types and custom taxonomies like this for your site?

#1912647

I understand what you are saying - but does that mean that the artists would have to enter each piece of artwork on a separate form? That would take too long.

So, check out this site on your examples: hidden link

That author has multiple books. Each book has different fields. Does the author have to enter each book on a separate form or can they enter multiple books with all of their information on a single form (and edit them so they can control their order)?

That's kind of what I am trying to go for.

#1913377

I understand what you are saying - but does that mean that the artists would have to enter each piece of artwork on a separate form? That would take too long.
Yes, the implication here is that each Artwork post must be created individually by separate Form submissions, unless you implement custom code using the PHP API to programmatically create these individual posts based on a single Form submission. That would require some understanding of PHP, WordPress APIs, and the Toolset API.

That author has multiple books. Each book has different fields. Does the author have to enter each book on a separate form or can they enter multiple books with all of their information on a single form (and edit them so they can control their order)?
In the Toolset system each post must be created by an individual Form submission, unless you have implemented a considerable amount of custom code.

How many pieces of artwork are we talking about, per Artist? An import process might be more practical if there are hundreds of images to process and categorize.

#1913403

Christian,

I understand. I am warming up to the idea of having them enter each artwork on a separate form. Once things are set-up, they would only be uploading a piece every so often, so that is fine.

Here is what I think I need to do based on your suggestions above:
1) post types: artists, artworks
2) taxonomies: medium
2) artists fields: name, headshot(img), bio
3) artworks fields: name, description, image, categories, tags, medium taxonomy

A question associated with this:
I assume I have to do a one to many association between the artists and the artworks to be able to connect the artist post and their art posts -- How do I connect the two automatically? by post owner? or ? I watched the videos but I only saw how to do it in the backend.

Thanks - almost there,
Lisa

#1913571
Screen Shot 2021-01-21 at 11.03.07 AM.png

I assume I have to do a one to many association between the artists and the artworks to be able to connect the artist post and their art posts -- How do I connect the two automatically? by post owner? or ?
Well it depends on what you want to achieve. A Toolset Post Relationship may or may not be needed here. Based on what you have described so far, I do not see a requirement for a Post Relationship just yet. The WordPress post author could be sufficient for organizing Artworks by Artist on the front-end of the site. Let's say the Artist post author is the corresponding artist WordPress User. In other words, the site admin is not the post author of the Artist post, the artist himself/herself is the author of his/her own Artist post. In this case, I think you would be able to filter any list of Artwork posts by post author successfully using Query Filters. I'm attaching a screenshot here showing the different configurations possible for a post author Query Filter.

Post author is the same as the logged in user
This would be useful for showing an artist a view of his/her own Artwork posts, but not very useful for other Users.

Post author is the author of the page where this View is shown
This would be great for a View of Artworks added to the Content Template for Artist posts, assuming the Artist is the author of his/her own Artist post. No post relationship is needed in this case, the User's Artwork posts would be displayed as expected.

Post author is the author of the current post in the loop
This would be useful if you create a View of Artists, then place a nested View of Artworks inside the loop. Apply this post author and the inner Artwork View will show only those posts created by the current Artist loop item. Again, this assumes the artist is his/her own Artist post author.

Post author is set by the parent User View
Similar to the previous example, but instead of nesting the View of Artworks in a View of Artists posts, the outer View would be a View of Users.

Author's ID is set by the View shortcode attribute: author
In this case, you can pass any arbitrary User ID into the View using a shortcode attribute like so:

[wpv-view name="Your View of Artwork Posts" author="123"]

This would show Artwork posts with post author ID of 123.

So you can see there are quite a few options available here. You may be able to achieve everything you need without a post relationship. One thing to keep in mind is that there is no way to create front-end custom searches with filtering by the standard post author field. That is not currently possible in Views/Blocks. Instead, you would need to use a custom field, taxonomy, or post relationship search filter.

If you need a post relationship for some reason, you can automate that post relationship using the Create Child Post feature: https://toolset.com/course-lesson/selecting-parent-posts-when-using-forms-to-create-child-items/#creating-forms-when-a-parent-post-is-preselected
If you need something more custom, I can show you how to programmatically set a post relationship using the Post Relationship API. I would need to know more about how the process of creating an Artwork post is initiated. For example, does the Artist visit a specific page on the site with a link to create an Artwork post? Where will that link exist on the site?

#1913605

This solution should work. I will open a new thread for user login/access control.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.