I had a second attempt to create a grouped alphabetic view which you can see at hidden link
I have created a parent taxonomy view where the taxonomy terms are the letters of the alphabet.
This calls up a custom post type child view which is filtered by the parent taxonomy.
Here is the parent view code:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-taxonomy-title]
[wpv-view name="companys-inner"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
The child "companys-inner" post view uses the filter;
'Select posts with taxonomy:
tax-companys set by the parent Taxonomy View'
This all works very well.
Now I need to find a way to create a front end filter for the parent view, so that the user can decide which letter of the alphabet (so which taxonomy term, they wish to filter by. So imagine a listing of the alphabet;
A B C D E F G H etc
And the user selects which of these terms they wish to filter the displayed posts by.
Taxonomy views do not have custom search fields like post views so I don't understand how to do this. I can see that the taxonomy view does have a taxonomy filter available but I can't see how to present this as a front end filter. Can you help please.
Regards
Robert
Dear Robert,
Yes, you are right, taxonomy view does not support custom search form.
As a workaround, you can setup a taxonomy view:
- query term's of your custom taxonomy
- in View's loop, display a link to pass term's ID as URL parameter "terms-filter", for example:
<a href='?terms-filter=[wpv-taxonomy-id]'>[wpv-taxonomy-title]</a>
Edit your the existed taxonomy view, add a filter:
Taxonomy term ID is set by the URL parameter "terms-filter", see screenshot term-search.JPG
Then it should be able to do same thing
Dear Luo
Your solution worked perfectly thank you. I have also added a hyperlink with text "ALL" to take you back to the unfiltered view. See hidden link
Regards
Robert