Skip Navigation

[Closed] setting alphabet pagination

This support ticket is created 3 years, 7 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
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)

This topic contains 4 replies, has 2 voices.

Last updated by Christian Cox 3 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#1774697

Tell us what you are trying to do?
Hi so if you go here: hidden link your see bottom of the content it has a alphabet pagination which should link A to all football clubs with A etc :).

so there is a taxonmy called section_home/football-clubs which is linked to page above then there is a Taxonmy called Footbal clubs where they are all stored :).

I am stuck on how to link this 2 up so can get the pagination working any help would be appreciated.

Thanks
Aaron

#1775063
query-filter.png
block-navigation.png

Hello, let me make sure I understand what you want to accomplish. It sounds like you have a custom taxonomy called "Footbal Clubs". I assume you have terms in this taxonomy that correspond to each letter in the alphabet. So your terms are a, b, c, and so on through z. You have applied the term "a" to the posts of Clubs whose name starts with "A", you have applied the term "b" to posts of Clubs whose name starts with "B", and so on. When a visitor clicks "a" in this menu, they will be redirected to a search results page where Clubs whose names start with "A" will be displayed in a View's results. If a visitor clicks "i-j-k-l", they will be redirected to a search results page where Clubs whose names start with "I", "J", "K", or "L" are will be displayed in a View's results. Right? Please correct me if I have misunderstood so far.

If I'm correct, then you could create a View of Clubs posts and add a taxonomy term Query Filter for the Footbal Clubs taxonomy where the term slug is any of the values coming from the URL parameter "alpha". See the query-filter.png screenshot here for an example of the settings of this type of Query Filter. The parameter name "alpha" is abitrary and you could really use any simple alphabetic text instead of "alpha" as the parameter name. This will configure the View to filter clubs posts by the footbal clubs term slug you set in a URL parameter. In other words, the filter will respond to a URL query string like yoursite.com/section_home/football-clubs/?alpha=a for results from a single term, or yoursite.com/section_home/football-clubs/?alpha=i,j,k,l using commas between the letters to include results from multiple terms on the same page. Then you will update the menu you created at the bottom of the page so your links point to the correct URLs, and place the View in the template or contents of this page.

If you're not famliar with adding Query Filters to Views, I can show you how to add this one. It depends on whether you are creating this View in the Block Editor (see #1 below) or the legacy Views editor (see #2 below).

1. If you are designing this View in the Block Editor, you must first select the top-level View block. The fastest way to do that is to use the Block Navigation menu at the top of the Block Editor. The menu looks like three stair steps, and allows you to see a hierarchical tree of the blocks in the block editor. See the block-navigation.png screenshot here showing this menu open and the top-level View block selected. Once you have the top-level View block selected, you should be able to find a Query Filter panel appear in the right column of Blocks configurations. Add your filter here, as shown in the query-filter.png screenshot.

2. If you're not using the Blocks Editor to create this View, you can add a new Query Filter in the Query Filter panel of the View editor screen. If you cannot find the Query Filter panel it may be hidden. Scroll to the top right corner of the screen and click "Screen Options" to display the Query Filter panel.

So it's not true pagination in the sense that it uses page 1, page 2, page 3 and so on...it's pagination that is created with a URL parameter that provides a term slug Query Filter.

Let me know if you have additional questions about this, or if you have trouble setting it up. I'll be glad to offer more direct guidance.

#1775117

Hi Christian,

You are correct except i not added A, B etc yet if i was to send you admin access would you be able to take a look and then guide me on how to set it up please? as i am new to using Toolset but i know its very powerful 🙂

Thanks
Aaron

#1776003

Yes please provide login credentials here and I will be glad to help you set up the search system I described. It should not be too difficult and I hope it will help you learn some more advanced Toolset concepts!

Private login fields will be available for your next reply.

#1784453
Screen Shot 2020-09-21 at 10.21.07 AM.png

Okay I have a quick update for you. First, I created a new custom taxonomy called Alpha Clubs here:
hidden link
This is a Flat taxonomy, not hierarchical. The only post type that uses this taxonomy is the Football Club post type.

To get you started, I added 3 terms to this taxonomy: a, b, and c. You may continue adding other letter terms here to complete the alphabet, or you can add terms on-the-fly as you edit Football Club posts (see the next paragraph below). Each letter a-z must have a corresponding term in this taxonomy: hidden link

Next, I assigned the corresponding first letter term to each of the following Football Club posts as shown in the attached screenshot:
a - Aberdeen FC Ltd hidden link
a - AEK Athens FC hidden link
a - Arsenal Football Club plc hidden link
b - Barnsley Football Club Ltd hidden link
b - Berwick Rangers Football Club hidden link
b - Blackburn Rovers Football & Athletic plc hidden link
c - Cambridge United Football Club Ltd. hidden link
c - Celtic plc hidden link
c - Chelsea Football Club Ltd. hidden link
You must continue adding the first letter term to each Football Club post if you want the post to appear in search results.

After that, I created the View of Football Club posts. You can edit the View here:
hidden link
I added one Query Filter so the View is filtered by the Alpha Clubs taxonomy, where the filter term is set by one URL parameter alpha as shown in the attachment query-filter.png in my previous reply. I added a post title with link shortcode in the loop of this View so you can see the results. You must continue designing the results as desired.

Then, I edited this Section Home post:
hidden link
At the end of the post content, I inserted the new View using a shortcode:

[wpv-view name="football-clubs-filtered-by-alpha-club-terms"]

Finally, I modified your pagination links. I added an "all" text link that links to the original page URL. I modified the "a" link to point to @yoursite.com/section_home/football-clubs/?alpha=a, where you can see the 3 Football Clubs that contain the "a" term. I modified the "b" and "c" links as well using the same URL structure. If you want to show results from more than one term, the URL must be in the format https://yoursite.com/section_home/football-clubs?alpha=a,b,c as I mentioned in my previous comment. You must continue updating the menu links as needed.

Please review the results and we can discuss any changes you would like to make. For example:
- What should the View display at the original page URL? Should it be empty until the User clicks one of the letter links? Should it show all the results first? Should the results display on a completely different page URL, like /section_home/football-clubs-results ?
- How will Users search for posts that begin with non-alphabetical characters? For example, this one begins with a number 1860: hidden link

The topic ‘[Closed] setting alphabet pagination’ is closed to new replies.