I'd like to achieve what you can see on this site. hidden link
1- Create a Glossary of a specific Post Type (MOTS)
2 - Show links to other MOTS . How can I "relate" posts from the same post type, view on hidden link as "Autres Definitions"
Thank you very much.
Hello,
Q1) Create a Glossary of a specific Post Type (MOTS)
You can try these:
1) Create a post type "MOTS",
2) Create a taxonomy "Glossary" and register it to post type "MOTS",
https://toolset.com/documentation/user-guides/create-custom-taxonomies/
3) Then create a post view:
- query "MOTS" posts
- filter by taxonomy "Glossary" with search form
https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/
https://toolset.com/documentation/user-guides/front-page-filters/
Q2) How can I "relate" posts from the same post type,
There are some ways to related posts in same post type.
1) Related posts with a taxonomy, for example:
- Create a custom taxonomy "my-tags", register it to Post Type (MOTS)
- edit each MOTS post, setup "my-tags" term value
- in a single MOTS post, create a post view:
a) Query query "MOTS" posts,
b) Filter by:
Select posts with taxonomy:
"my-tags" the same as the current post in the loop
https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/
You will get related "MOTS" posts by taxonomy "my-tags"
2) With a intermediate post type using post type relationship, see our document:
For example, create another post type "my-intermediate-cpt", setup two one-to-one relationships:
- one-to-one "relationship A" between "MOTS" and "my-intermediate-cpt"
- one-to-one "relationship B" between "MOTS" and "my-intermediate-cpt"
It can also setup relationships relationship between posts of same post type.
See our document:
How do I associate one child with several parents of the same type
https://toolset.com/faq/how-do-i-associate-one-child-with-several-parents-of-the-same-type/#using-an-intermediary-custom-type
And I recommend the first option: "Related posts with a taxonomy", which is easy to setup and it is built-in feature of WordPress.
Thanks:
Q1 - When creating the view with Content Selection "Post Types" / "Mots" and adding a Taxonomy filter I do not see the search option. Or should the view display "Taxonomy" rather than "Post Types" I will then have search form option in the Query Filter. Thanks
You can follow the document to setup the search form:
https://toolset.com/documentation/user-guides/front-page-filters/
Building Custom Searches for Any Content Type
in section "Filter Editor", you can setup a taxonomy field into the search form:
https://toolset.com/documentation/user-guides/front-page-filters/#vfmh-adding-search-controls
Adding inputs to the search form
Does that mean that we have to go back to all our post "Mots" and apply the new Glossary taxonomy?
Yes, you are right, you have to edit each "Mots" post, and setup the Glossary term in it, just like WordPress built-in taxonomy "category".
In fact the Glossary will be based on the custom field "Indexes" from the group "Langues/Indexes/Valeur/Calligraphie". Any documentation on this? Thank you.
If it is a custom field, you can setup the custom search form in post view by following the same document as I mentioned above:
https://toolset.com/documentation/user-guides/front-page-filters/
And here is a document about "Filtering Views Query by Custom Fields":
https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/
But in my opinion, custom taxonomy is easier than custom field.
For your reference.
I was trying for another of your ticket. I guess I am having the same issue, to create the glossary with a | B | C |....
Thanks for the details, I agree, it should be similar problem as the thread you mentioned above:
https://toolset.com/forums/topic/a-z-filter-glossary/#post-1200782
and the test site is still available, you can login into it and check the settings, I copy/paste the detail of post here:
I assume we are talking about this:
- Custom post type "countries", with posts:
- Custom taxonomy "alphabet"
See below test site:
hidden link
username/password: xgren/111111
in above page, you can search the country posts by taxonomy "alphabet"
You can get the view's setting here:
hidden link
1) in section "Query Filter", use below filter:
Select posts with taxonomy:
alphabets slug in one of those set by the URL parameter wpv-alphabet
eg. hidden link
2) in section "Search and Pagination", use below codes:
...
[wpv-control-post-taxonomy taxonomy="alphabet" type="select" url_param="wpv-alphabet"]
...
For your reference.
I am trying to setup the search using the custom filed "Indexes" for Mots.
I got the form to work
hidden link
But I have difficulties displaying the results (no results). I triple checked the view code and don't find the error.
The view is:
hidden link
Thank you.
Please check these:
1) In case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2019, and test again
2) You can also provide your website credentials in below private message box, I can setup a demo for you.
Thanks for the details, please edit the post view "Mots Indexes Custom Search":
hidden link
click "Screen Options", option "View purpose" choose "Full custom display mode", then you will see section "Query Filter", you are using below field filters:
Select items with field:
Indexes is a string equal to indexes2
AND
Indexes is a string equal to URL_PARAM(wpcf-indexes)
It conducts the problem, I have removed the first one, as below:
Select items with field:
Indexes is a string equal to URL_PARAM(wpcf-indexes)
Please test again, check if it is fixed. thanks