Skip Navigation

[Resolved] Glossary + Displaying related posts from the same post type

This support ticket is created 5 years, 11 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: Asia/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 13 replies, has 2 voices.

Last updated by Luo Yang 5 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#1203431
Screen Shot 2019-02-20 at 12.11.37 PM.jpg

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.

#1203602

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.

#1204074
Screen Shot 2019-02-21 at 12.29.42 PM.jpg
Screen Shot 2019-02-21 at 12.30.11 PM.jpg
Screen Shot 2019-02-21 at 12.30.26 PM.jpg

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

#1204163

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

#1204648

Does that mean that we have to go back to all our post "Mots" and apply the new Glossary taxonomy?

#1205226

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".

#1209806

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.

#1209809

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.

#1210357

I was trying for another of your ticket. I guess I am having the same issue, to create the glossary with a | B | C |....

#1210368
#1210378

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.

#1212367

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.

#1212386

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.

#1212409

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