Skip Navigation

[Closed] Displaying Info from a Post's Relationship.

This support ticket is created 4 years, 1 month 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 7 replies, has 2 voices.

Last updated by Jamal 4 years, 1 month ago.

Assisted by: Jamal.

Author
Posts
#2237061

Tell us what you are trying to do?
I would like to display information based on a related post or a relationship. For example, a sports team jersey has attributes that relate to other entities. If I have a custom post type "jersey ID" and a relationship to "Org ID" is set to "Tampa Bay Buccaneers" I would like to know that "NFL", a property of "Org ID", is the League of "Jersey ID".

Is there any documentation that you are following?
I am unsure what to look for. I see Relationship Fields of custom posts and I saw there is a way to make a many-to-many relationship, but I am unsure about that yet. I am still early on figuring this out. I have a general outline of the datasets I need.

Is there a similar example that we can see?
As I understand it, there isn't an example of what I am trying to attempt, but sites related to similar subjects like
hidden link

What is the link to your site?
hidden link

#2237357

Similarly, I have CPTs that relate to one another but I am not sure which toolset features help me display what I need.

Bear with me as I describe my plight without the expert jargon of professional Database Managers.

The LA Rams (a sports $organization) has 6 $orgEras with beginning and ending years or a beginning year and current.

hidden link

Each $orgEra has versions of a primary logo.

The LA Rams ($organization) has $jerseyEra[s] comprised of different $jersey variants across different beginning and ending years or a beginning year and current.

hidden link

And each team-specific $jerseyEra has individual $jersey variant attributes “primary team color”, “primary white”, “vintage”, “color rush”

Each $jersey has one or more $fontFamily[ies] shared between other $jersey[s], $jerseyEras, and other $organizations. (Like generic block $fontStyle[s] shared between Baltimore Ravens and Jacksonville Jaguars $orgEra[s].)

Each $fontFamily has one or more $fontStyle[s] but $fontStyle[s] never have more than one $fontFamily.

In excel, you can use index and match functions to specify multiple criteria to return the first applicable result. (Lookup value1 from column A, Table A in column Z, Table B and value2 from column B, Table A in column Y, Table B and return the results of column X, Table B. The first row matching both value1 and value2 in columns Z and Y, respectively, returns a result from column X.)

Also in excel, one may nest lookups between tables. (Lookup value1 of table A for result1 in Table B. Then lookup result1 in table C for result2.

Is there a way to specify relationships between $jerseyEra, $orgEra, $fontFamily, and $fontStyle and then, as long as tenable a relationship exists, lookup applicable $fontStyle[s] matching both $jerseyEra and $orgEra criteria?

A second multi-criteria situation: can one return a $logo associated to an $orgEra and $jerseyEra which two are also associated to a $fontFamily?

Is there a way to specify relationships of $jersey to $jerseyEras and $jerseyEras to $organization and return the $organization name in context with the $jersey? A nested lookup.

Or lookup a $logo via $orgEra for $jerseyEra?

#2237531

Hello and thank you for contacting the Toolset support.

I must confess that I am not sure to fully understand the scope of your project. I understand that you want to have search pages for font styles and logos based on search criteria(Organization, Jersey, Maybe dates), right? Can you elaborate more.

On the meantime, it is worth mentioning that Toolset views can perform search with only ONE relationship at a time. To use more than one relationship, you will need custom code to alter how the view will query the database.
On the same time, Views cannot query a custom post type based on a relationship, taxonomies, or custom field of a related post. They can only query based on the same post type. For example, you cannot search for custom post type A with taxonomies or custom fields for a custom post type B that is related to A.

On the other hand, you can have multiple taxonomies filters, and multiple custom fields filters. However, searching by custom fields is slower than searching with taxonomies.

This being said, I think that you should consider some taxonomies. For example, the organizations would be better as a taxonomy rather than a post type. Maybe JersyEra(s) should also be taxonomies.

The elements to search(Font Styles, Logos) must be post types, because Toolset supports search only for posts(vs taxonomies, or users).

To better advise you further, can you provide more details about the project? What pages do you intend to have? What search filters? Etc. Any additional information will help us understand your needs better and advise you accordingly.

#2237653

Salut Jamal,

Il fait un court temps depuis que j’avais écris un francophone. Merci pour votre réponse.

Please excuse my poor French grammar.

I think it makes sense to move leagues to a taxonomy.

What are options for custom code? I submitted a request for a consultant to guide me through my roadblocks.

I think I got a bit crazy trying to figure it all out on the fly and learning what toolset can do.

If I can sign up for consulting work and work out an NDA, I’d like to give over more details.

#2237665
#2238023

Salut Jonathan, et merci pour votre retour. Je suis le seul membre de l'équipe de support qui parle français. Ainsi je peux assister nos clients francophones qui préférent continuer en français. Malheureusement, nous ne pouvons pas ouvrir le forum français pour l'instant. Du coup, ça m'arrive de continuer en français sur le forum anglais si c'est nécessaire. Je vais continuer en anglais, mais si vous préférez le français, nous le ferons 🙂

Actually, we do not offer any development or consulting services. We created the job board as a platform to connect our customers with our partners. I don't have access to the last URL that you shared, but I assume that you posted a job offer. The contractors that are eligible will receive notification emails and will get back to you.

As part of your Toolset subscription, we deliver to you the last updates of the plugins, and technical support here on the forum.

I'll remain at your disposal. Let me know if you have any further questions.

#2242597

Hello,

I am trying again to use Toolset, it's actually getting quite frustrating. I may have to give up.

I restarted all of what I had before to try using taxonomies and fewer custom post types. I've attempted to have a repeating group within a repeating group for a custom post type.

Example:
Custom Post Font Family
Repeatable Field Font Style Group
Repeatable Field Font Style

I can't seem to figure out how to bring forward the information within the repeatable field under font group.

https://toolset.com/2017/08/preview-for-nested-repeating-fields-groups/

this article above says something about nesting views within one another, but this says it's unsupported.

I really just need to be able to build out the data and show the information... This is much harder than the tutorials make it seem.

#2243391

I understand the frustration you may have while using Toolset in the first time. Toolset may feel overwhelming in the first time, but as long as you get familiar to it and its concepts, you will find it very powerful.

Indeed, to display nested Repeatable Field Groups, you will need nested views. Nested views are not supported yet, in the blocks editor. But, you can still nest views, either through an intermediate content template, or through the legacy views. The idea, is to create the nested view, inside a content template(not assigned to any custom post type), then include the content template inside the loop of the parent/first view.

I am afraid, that the blocks editor may be difficult for creating the nested view, because the editor needs to know the context of the view in order to build the preview, and offer the dynamic sources, which can be challenging in the blocks editor.

Which will bring us to use the legacy editor. You can activate it in Toolset->Settings->General(tab)->Editing experience. For some video tutorials about the legacy editor, check our old videos(+3years) here hidden link
Or check in other videos on Youtube that are older than 3y, before we support the blocks editor.

If you want me to prepare an example on your website, allow me temporary access and I'll do my best to help. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

The topic ‘[Closed] Displaying Info from a Post's Relationship.’ is closed to new replies.