Skip Navigation

[Résolu] Pedigrees

This support ticket is created Il y a 3 années et 2 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

Marqué : 

This topic contains 11 réponses, has 3 voix.

Last updated by Christian Cox Il y a 3 années et 2 mois.

Assisted by: Christian Cox.

Auteur
Publications
#1940437

A few years back I had a phone conversation with your developers and Beda on the possibility of creating a pedigree (for example see here: hidden link) At that time it simply was not possible but they were hoping to implement it. Sadly I never heard back and I do not know if our discussion was ever acted on.

Custom post type 'Dogs'
Each dog would have it's own post
Parents, grand-parents and great-grand-parents would be drop-down box
User to be able to start typing name in drop down box, rather than have to scroll down long list
Drop down box to be further filters on whether male or female

#1940873

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

The thing is that you can add the post-relationship filter to filter your view so you can display Parents, grand-parents and great-grand-parents would be drop-down box.

User to be able to start typing name in drop down box, rather than have to scroll down long list
==>
This is not possible as there is no such feature exists yet, you have to select from the list of options presented by dropdown.

Drop down box to be further filters on whether male or female
==>
No, there is no such feature available.

Here is the related doc about how you can filter the view results with related posts:
- https://toolset.com/documentation/legacy-features/views-plugin/how-to-filter-by-related-posts/

#1941119

Sorry, I didn't explain very well at all and only gave half the information!! I am not after a search or filter as such.

Users to add their dog using a post form.

In that form they would complete the pedigree by being able to select each parent, then each grand-parent, then each gt grand-parent.
So the drop down for each of those would display all 'dogs' in database.
As there is going to be a vast number I thought we could start to type the name, but perhaps not then?
And there is no way to filter so we can only select male for father and female for mother?

The resulting displayed post would then display the pedigree with links to the parents, etc.

#1942181

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Users to add their dog using a post form.
==>
Ok

In that form they would complete the pedigree by being able to select each parent, then each grand-parent, then each gt grand-parent.
So the drop down for each of those would display all 'dogs' in database.
As there is going to be a vast number I thought we could start to type the name, but perhaps not then?
And there is no way to filter so we can only select male for father and female for mother?
==>
Do you mean you have already added the three fields for parent/grand-parent and great grand parent already added to your post form and you want to add the feature so that user can type to search within parent/grand-parent/great grant parent?

#1942525

==>
Do you mean you have already added the three fields for parent/grand-parent and great grand parent already added to your post form and you want to add the feature so that user can type to search within parent/grand-parent/great grant parent?
<==
1. Custom post type 'dogs'
2. Each dog will have it's own post and post title will be dog's name
3. All dogs in pedigree will already have it's own 'dogs' post
4. User creates a new 'dogs' post
5. Field for sire will be a drop down box of dogs (posts) in the CPT 'dogs' post title, hopefully filtered by 'sex' field to only show males.
6. User to select dog for sire field from said drop down box, preferably from starting to enter the name rather than have to scroll down lots and lots of names.
7. Field for dam will be a drop down box of all female dogs in the CPT 'dogs'
8. Repeat #6
9. repeat process to select grand & great grand parents.

Drop boxes in pedigree are not listing/searching the parent/grand/great grand parent fields, but will be the post titles in the CPT 'dogs'

I hope that is a bit clearer? As I mentioned, I spoke in great detail in a group phone call with the head of development and Beda, but it was a few years ago now. They said they thought they could get it to work.

#1943353

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

You said, you had a call for almost two years before and that is large gap. And product is changed a lot in that time where we are more focusing on Toolset Blocks.

Thank you for sharing the detailed information but until and unless I see where you added your form from where user should create the doc and how exactly for now the user select the doc from lots of options presented by dropdown I will not be able to guide you in the right direction.

I will require to review your current setup and for that I will require admin access details and problem URL and you can share few screenshots what dropdown you want to update with text writing rather selecting the option from lots of options presented.

Can you please share problem URL(s) and admin access details so that I can review your current setup and share all detailed information what field you want to change to text input field.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1943525

>> You said, you had a call for almost two years before and that is large gap. And product is changed a lot in that time where we are more focusing on Toolset Blocks. <<
Actually it was probably nearer 6 years ago. But that's my point, knowing how much it has changed I had hoped that the necessary changes had been made but as Beda no longer works there nobody came back to me.

As I stated, It is a new site that is under development. A pedigree was not possible to do when I did the site originally. At the moment all the parents, grand parents and great grand parents are merely a plain single line text field and not linked to anything, except sometimes with a manual link. At the moment the user will simply type in the content for each parent field. This is not good as they often make spelling mistakes.

I am asking can this be done and if so how. Therefore there is nothing for you to see. There is no 'problem url'

With no disrespect meant, You do speak very good English but you obviously can not understand what I am trying to do, and I do not know how to explain it in a way that you will understand. I wonder if this ticket could be passed to somebody whose who will be able to understand, perhaps Christian, whose first language is English and perhaps can understand the culture of pedigrees a bit easier?

#1943527

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Christian does not work on Friday and Saturday. He will back to work on Sunday:
- https://toolset.com/forums/users/christian-c/

If you agree - I'll pass this ticket to him.

#1943749

Thank you. Yes please.

#1947647

Hello, it sounds like you need a way to create relationships between posts in the same custom post type - Dogs. Unfortunately Toolset's post relationships are not currently able to connect posts from the same custom post type, so Toolset's post relationships don't apply in this scenario.

Wordpress also offers hierarchical post types, like Pages, in which each post can belong to one parent Page hierarchically, and have an unlimited number of its own children. But that doesn't really help in this situation either, because you need the ability to have two parents of the same post - the sire and the dam.

Furthermore, when creating a post, you would like to offer your Users the ability to choose sire and dam individually from dropdown lists of all Dogs, filtered by sex, and possibly offer the ability to start typing in a text input to filter those gender-specific lists of Dogs by name (i.e. the Dog post title). The only type of input in Forms that offers this select/typeahead functionality is the Post Relationship field. However, as we've already mentioned, you cannot connect multiple posts from the same post type in Toolset's Post Relationships.

So realistically speaking, this isn't something you will be able to accomplish easily in Toolset exactly as you've described. Probably the most effective workaround in the current software is to include two custom fields on every Dog post - one for sire and another for dam. That custom field will store a numeric ID representing the sire Dog post or the dam Dog post, respectively. In wp-admin, the field would only show a numeric value, like 123. This makes management in wp-admin a bit more difficult, since you would need to know the post ID of the sire or dam Dog post to set the field value manually.

In the Form to create or edit a Dog post, you will include two generic select fields - one for selecting the Sire and another for selecting the Dam. You can use Views to generate the options for these select fields dynamically, showing the Dog post title to the User but capturing the post ID for the database. I can show you examples of this if you'd like. However, these select fields are not true post relationship fields, and do not provide the functionality that allows you to start typing to filter the list. That feature is not available for custom field management, and requires custom code.

With this generic field setup, you would establish the hierarchical relationships between each dog and its direct parent dog posts by storing the related post IDs in custom fields. For consistency throughout the site, it seems you would not establish relationships beyond the parents directly in the child post Form. It seems that those relationships would be inherited from the parent Dog posts. In other words, the grandparent Dogs of a child Dog are not maintained or managed directly in the child Dog post, they are inherited from the sire and dam fields of the parent Dog posts, which in turn inherit their grandparents from their parents, and so on and so on, as far back as records are maintained.

Otherwise, you need a much more complex management system, where multi-generational hierarchical relationships must be established arbitrarily in each Dog post, and the relationships set and maintained in ancestor posts may or may not directly influence the relationships in the current post.

Your thoughts?

#1948949

Thank you so much Christian! It is a shame that nothing came from my previous phone conversation, but it's probably too complicated to spend the time required.

>>>In the Form to create or edit a Dog post, you will include two generic select fields - one for selecting the Sire and another for selecting the Dam. You can use Views to generate the options for these select fields dynamically, showing the Dog post title to the User but capturing the post ID for the database. I can show you examples of this if you'd like. <<<

I'd be grateful if you could show me an example.

#1951789

I'd be grateful if you could show me an example.
This example is based on the legacy Views editor. Create a View of Dogs, and add a Query Filter based on sex. The consolidated loop code should be:

[wpv-layout-start][wpv-items-found]<!-- wpv-loop-start --><wpv-loop>[wpv-item index=other]{"value":"[wpv-post-id]","label":"[wpv-post-title]"},[wpv-item index=last]{"value":"[wpv-post-id]","label":"[wpv-post-title]"}</wpv-loop><!-- wpv-loop-end -->[/wpv-items-found][wpv-no-items-found][/wpv-no-items-found][wpv-layout-end]

Check the checkbox "Disable the wrapping DIV around the View".

Then in the generic select field, you can insert this View in options:

[cred_generic_field type='select' field='wpcf-fieldslug']
{
"required":1,
"default":[],
"options":[[wpv-view name="your-view-slug"]]
}
[/cred_generic_field]

That's the general idea. The View results will be used to populate the options of a generic select field.

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