Skip Navigation

[Resolved] How to create a many to many query of images?

This support ticket is created 4 years, 5 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 5 replies, has 2 voices.

Last updated by Jamal 4 years, 5 months ago.

Assisted by: Jamal.

Author
Posts
#1997319

Tell us what you are trying to do?

1. I want to make a block with 5 selection fields [A, B, C, D, E] where I can -select- one or more images per field instead of text;

2. All the images I selected on:
- column A one;
- column B one: child of column A;
- column C: one or more: child of column B;
- column D one or more: child of column D;
- column E one
has to be exported or printed to a pdf format on a specified row.

How can I setup 1 and 2?

Is there any documentation that you are following?
I followed every video.

Is there a similar example that we can see?
no.

What is the link to your site?
no example available at the moment [only empty test site]

#1997387

Hello Peter and thank you for contacting the Toolset support.

However, I am really sorry, I don't understand what you are trying to build. You said many-to-many query, but you did not explain what are the existing relationships you have.
Can you elaborate more on this request? Maybe add a sketch that explains the part you want to build, and where each part should come from(post's attachment, relationship, etc.)

#1997519

Hi Jamal,

Maybe this will help:

I have 3 tables in the -example- on hidden link [created with another plugin]:

[A] product type
[B] product group
[C] product

When I open the page, I only want to see 3 pull down menu's, where you 1st select A, then B and then C [in a 3 columns view].
An example of the tables:

Choose [A] product type: Choose [B] product group: Choose [C] product

- When I make a single selection of product type [A], I want that [B] shows a list and display the child of [A].

- When I make a single selection of product group [B], I want that [C] shows a list opens and display the childs of [B] where I can select ONE or MORE products.

The selected choices have an image too. The images must be exported to a pdf or word file.

I hope you can give me a good advise how to set this up.

Thank you in advance,

Best regards,
Peter

#1997567

Thank you Peter for this explanation. But, I might still need more details to better advise you. From a WordPress perspective, what are the data types(Post types, taxonomies, fields) and Toolset relationships you are using?

In the meantime, I would like to show you our "C&B Properties – Real Estate Site" demo site on our discover-wp.com platform
https://discover-wp.com/site-templates/

As you can see in the "Find a property" page, when you select a state, the cities dropdown gets updated. And when you select a city and click on submit, the properties posts get updated to display only the posts from the selected city of the selected state. That's somehow what you want to build with "Product type>Product group>Product", right?
- hidden link

This demo is implemented in the following way:
- State, City, and Property are 3 custom post types.
- State and City have a one-to-many relationship(One state can hold multiple Cities).
- City and Property have a one-to-many relationship(One City can hold multiple Properties).
- The "Find a property" page includes a view that has filters for State and City, and where both City and States are ancestors of the view's custom post type(Property).

Please note that this kind of filter can only be implemented for One-to-many relationships. With as many levels as possible.

Read more about relationships here https://toolset.com/related-lesson/post-relationships/
Check our full course on how to build a similar website to this demo site here https://toolset.com/course/wordpress-real-estate-sites/

Regarding the layout(3 columns), that becomes easy once you decide what data model to work with. The blocks editor offers a columns block that you can configure to use 3 columns, and you can put the filters, or loop results inside the column that you want.

#1997811
Toolset_reply_ticket_210323.JPG

Hi Jamal,

// From a WordPress perspective, what are the data types(Post types, taxonomies, fields) and Toolset relationships you are using?
> I'm using 'Symbols' as Post type. In fact a 'Symbol' is only an image with a Title.
> I'm using 'Product groups', 'Products', 'Packaging type' and 'Transport type' as taxonomies for each new Symbol I add.
> I use no Toolset relationships.

A end-use must can select a Symbol of a product group, 1 or more products who are in the specific product groups, a packaging type and a transport type.

Best regards,
Peter

#1997947

Well in this case that becomes even easier. A view with those filters can do that.

Just note that the only connections, between two taxonomies, are the posts assigned to both of them. Toolset offers the possibility to display taxonomy terms that have posts in the results.

If you are using the legacy editor to build the view, you can activate this option in "Custom Search Settings-> Let me choose individual settings manually->Show only available options for each input". Check this screenshot hidden link
Build the columns for the view using the Bootstrap grid. You can activate loading Bootstrap in Toolset->Settings->General.
hidden link

If you are using the blocks editor to build the view, you can activate the option in the "View Search" block. Check this screenshot hidden link
Build the columns using the default WordPress column block. Or the Toolset Grid block. Check this screenshot hidden link

Note that the taxonomy filters will be inside the "View Search" block, and the Symbol posts will be inside the "View Output->View Loop" blocks.

I hope this helps. Let me know if you have any questions.