Hi,
Thanks for sharing the update.
Using pagination is complex in this case because the source of the slot machines posts is not a single view, but multiple views for each provider post.
To clarify, if you were simply showing the list of all slot machines, the list's structure from the view would look like this:
(1). Slot machine A
(2). Slot machine B
(3). Slot machine C
(4). Slot machine D
(5). Slot machine E
(6). Slot machine F
In that case, pagination would've worked to split the list into multiple pages.
However, in your usage case the structure is different:
1 - Provider A
-- (1). Slot machine A
-- (2). Slot machine B
2 - Provider B
-- (1). Slot machine C
-- (2). Slot machine D
3 - Provider C
-- (1). Slot machine E
-- (2). Slot machine F
Notice how the available slot machines are not at the same level and their ordering of results is changed and reset for every provider (the number in brackets).
If it's an absolute requirement to use pagination with this list of available slot machines, you'll need to adopt a slightly different strategy.
The two existing views ( "A - Parent View Casino - Provider" & "B - Child view Provider - Slot" ) will not be used to show the designed list of slot machines, but they'll be used only to get the IDs of all the applicable slot machine posts.
( in comma separated format e.g. 1, 2, 3, 4 .... )
You'll then create a new third post view for the slot machines posts, which will use those slot machine post IDs, to show those selected posts in the required design/layout. Since these posts would be coming from a single view, the pagination will also work.
Here are the steps:
1. "A - Parent View Casino - Provider" view:
- Please select "No pagination" in the pagination settings.
- To remove the extra content and spaces from this view's output, update the content in the "Loop Editor" section to:
[wpv-layout-start][wpv-items-found]<!-- wpv-loop-start --><wpv-loop>[wpv-view name="b-child-view-provider-slot"]</wpv-loop><!-- wpv-loop-end -->[/wpv-items-found][wpv-layout-end]
- From the "Output Editor" section remove the shortcode [wpv-filter-meta-html] and check the option "Disable the wrapping DIV around the View" just above this section.
2. "B - Child view Provider - Slot" view:
- Remove the extra line breaks and spaces from the content in the "Loop Editor" section and replace content template shortcode with only post ID shortcode and a comma:
[wpv-post-id],
[wpv-layout-start][wpv-items-found]<!-- wpv-loop-start --><wpv-loop>[wpv-post-id],</wpv-loop><!-- wpv-loop-end -->[/wpv-items-found][wpv-layout-end]
- From the "Output Editor" section remove the shortcode [wpv-filter-meta-html] and make sure that the option "Disable the wrapping DIV around the View" is checked.
To test if these two views are working as expected use the shortcode of the parent view on any single casino page and see if returns the IDs of the relevant slot machines in the comma-separated format:
[wpv-view name="a-parent-view-casino-provider"]
3. "C - Actual view Provider - Slot" view (new):
- You'll create a new post view to show the slot machines post and in the "Query Filter" add a post ID filter to include only posts which are included through shortcode attribute:
( ref: https://toolset.com/documentation/user-guides/filtering-views-query-by-post-id/ )
Example screenshot: hidden link
- In this view, you can set the pagination settings and design the output according to the requirement, as the final output would be generated using this view.
To show this view on the single casino pages, you can place its shortcode like this:
[wpv-view name="slug-of-the-view" ids="[wpv-view name='a-parent-view-casino-provider']"]
Replace "slug-of-the-view" with the actual slug of your new view and note how the shortcode of the "a-parent-view-casino-provider" view is used in this shortcode to pass on the required post IDs.
( ref: https://toolset.com/documentation/user-guides/passing-arguments-to-views/ )
I hope this helps and please let me know if any step is not clear.
regards,
Waqar