Skip Navigation

[Gelöst] Follow up question regarding pagination

This support ticket is created vor 7 Jahre, 10 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 28 Antworten, has 2 Stimmen.

Last updated by Minesh vor 7 Jahre, 9 Monate.

Assisted by: Minesh.

Author
Artikel
#411002

Hi Minesh.

Instead of editing functions.php, please use "Snippets" in the side bar of the dashboard above users.

Snippets ==> Add New ==>

You can add a new snippet, does the same thing and doesn't mess with updates.

Edit: Snippets is great because you don't lose edits if you update the theme, and the functions are still there if you change the theme! Fantastic tool!

I Highly recommend it!

https://wordpress.org/plugins/code-snippets/

#411009

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please check now, you will be able to see now all posts and it will not lead to 404 page error.

I've added following snippet:

function func_get_prd_id(  ) {
  
  if(isset($_GET['parent_id']) and $_GET['parent_id']!='')
			return get_permalink($_GET['parent_id']);
}
add_shortcode('get_prd_id', 'func_get_prd_id',10,2);

I hope this help you to resolve your issue.

#411012
Untitled-3.jpg

Thank you Minesh!

Don't you think snippets is a great tool?

Just to follow up on the first part of the ticket please..

Step 1, browse to sale:
hidden link
Step 2. Click on Lot other than lot 1
You will see that the URL says lot xx, however displays the date for lot 1.

#411032

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

As I said - the 2nd view will filter based on the "parent_id" you passed as URL param. It will not take pagination from middle of the page, that view is responsible to display all the records that are child of "parent_id" as URL param and then it will generate the pagination.

#411104

So when a user clicks on any lot from the sale view, the loop will always start at lot 1, no matter what lot number was clicked?

I can see when the page loads for a split second the correct lot starts to load before it is replaced with lot 1.

I am trying to understand why this happens and if we can find a solution because the pagination only adds value if the correct lot is loaded.

As I understand the url has two elements:

 [wpv-post-url]

This is the url of the post being clicked.
The we have the parameter:

&?parent_id=[wpv-post-id id="$sale"]

This is the parent ID.

What I am trying to understand is why it is starting on lot 1 if the URL is correct.

I understand that the parent-id is necessary for the pagination, so the loop knows which is the previous and next post.

What I don't understand is why the view jumps to the first lot when the URL is telling it which lot it is.

#411210

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Basically - what happens with your current setup.

When you click on lot - it redirected to the lot page with parent_id which display the ALL childs of given parent. So child view generate pagination from first, it will fetch ALL child records of given "parent_id" and generate the pagination. Each view has its own pagination, so you can not transfer your parent view pagination to child view pagination.

I hope you understand now what I'm saying.

#411267

Thanks Minesh.

Is there any set up or solution that I can investigate further as it is imperative that the lot that the person clicks on from the sale view is the lot that they land on. Further more the ability to page between lots is vital.

#411278

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

I can see that you have used single content template to display lot.

What if you try to display first All "single" lot information which is selected by user and then display the view?

so this will be:
= user select lot
= user redirected to selected lot page
= at top of the page you should display selected lot information and then view

Makes sense?

#411666

Hi Minesh.

Sorry man, I have been trying to wrap my head around what you are saying but it just isn't clicking in my mind.

Please can you elaborate a little for me so I can give it a shot.

#411675

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Step 1, browse to sale:
hidden link
=> This page is lising your parent items
=> you use view to display parent items - please note pagination will belong to this view (one view one pagination), so for this view, this pagination belongs to parent view

Step 2. Click on Lot from above parent page
hidden link
=> so this will display All childs that belongs to parent = parent_id=5416
=> here you also use another view to display child items, again for this view pagination belongs to this child view, not parent view as pagination belongs to view for which you are loading the content. so this pagination belongs to child view

Now, you want that , when we load this:
hidden link
pagination should be the one that parent has, right? thats what I would like to convey you that pagination belongs to view which display the view content currently.

#415419

Hi Minesh.

I have been trying to wrap my head around what you are suggesting but I am having difficulty understanding the mechanism of what you are saying. The problem to me seems like there should be a simple solution.

What should i be focussing on to change this to work like it should.

As far as I understand, I have set up the view for "Step 1" to display children of x sale

 Now, you want that , when we load this:
<em><u>hidden link</u></em>
pagination should be the one that parent has, right? thats what I would like to convey you that pagination belongs to view which display the view content currently.

What I am confused about with your suggestion above is it sound like you are suggesting a third step which seems redundant, unless of course I am not understanding what you mean?

Sorry for the questions but I find your answer confusing and would be most grateful if you could assist me by explaining how I can get this pagination to work.

1) land on sale
2) select lot and be directed to the page of that lot
3) be able to browse (back and forward)

Thanks for your patience.

Josh

#415428

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Unfortunately, I do not able to access the link as to access URL it requires access details and access details are not working.

What I would like to convey message to you that:
=> hidden link
-- Above URL will list all childs which have parent 5416 using view - right?.
-- So this view is filtered by parent ID and this child view has its own pagination. - right?
-- Lets say we have 15 chid records with parent ID 5416. So above child view will load 15 results with pagination

Now, again as I understand you want to load paginate child records from the selected child record - right? For example, we have 15 child records and you clicked on 6th record so you want to paginate from 6th record on auction lot page - correct?

The best thing would be for you is that I think you should go through our pagination tutorial.
=> https://toolset.com/documentation/user-guides/getting-started-views/part-4-pagination/

You can also play by creating a test site on discover-wp.com.
=> https://toolset.com/faq/how-and-why-to-create-a-test-site-in-discover-wp/

There are the number of reference sites available using which you can learn a lot how you can configure your views as well as the parent-child relationship.

#415436

Hi Minesh.

Thanks for your reply.

The login details should still work as I have not deactivated your admin account. I notice there are two PM's with access details. I have updated both to be correct.

If I am going by what you are saying, the process would work like this:

Step 1, browse to sale:
hidden link

This page lists all child items belonging to sale (this is how it works currently)

Step 2. Click on Lot from above parent page
hidden link
=> so this will display All childs that belongs to parent = parent_id=5416

* So this will display the exact same content as the previous page according to what you are saying?
This where I am getting confused as the step seems redundant as it is displaying the same results as the previous page?

I want to make this work however it will fit into the toolset restrictions
The current journey is as follows:

1) Visitor is on past or future auction page:
hidden link
2) Visitor selects sale
This where all lots are displayed with the parametric search.
Visitor is able to filter the view or browse through with the pagination.
3) If visitor selects an Auction lot they want to read further info on, at this point they should be directed to the page that displays that particular lot.
You mentioned:

 Now, again as I understand you want to load paginate child records from the selected child record - right? For example, we have 15 child records and you clicked on 6th record so you want to paginate from 6th record on auction lot page - correct?

What you said above is 100% correct.

All I am asking you is guidance on how to get this to work properly. I choose to ask specifically for your assistance because you have an understanding of how the post types on this project work together. I value your input.

I have read through the pagination tutorial multiple times as well as the reference sites and fail to see anything that relates to this kind of scenario.

#415508

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Now, again as I understand you want to load paginate child records from the selected child record - right? For example, we have 15 child records and you clicked on 6th record so you want to paginate from 6th record on auction lot page - correct?

What you said above is 100% correct.
=> Yes - I understand your requirements before as well and what exactly you are looking for and I would like to thank you for choosing me to help you further.

I really do love to help you further but the thing is that the function you are looking for is not supported by toolset natively.

Views do not offer Single Post pagination. Single posts pagination may be provided by the Theme. If your theme does not provide this, you could use Custom Code to create Pagination links.
See this related ticket as well:
https://toolset.com/forums/topic/pagination-for-custom-post-type-single/

What you want is:
click on item selected item (which you select from the previous page) and then you want to display that selected item with exact order, for example, if you click 5th item, on next page you want to start pagination from 5th item, its not possible as on next page it's a different view with pagination.

Toolset Views will allow you to create a LIST of your Posts and then, you can paginate that list, it will not allow you like you make a list with one view, click on one item, display the result with the second view and paginate further.

I do understand your concern but there is no doubt that this may need custom programming. if you need custom programming for your site, please feel free to contact our certified partners.
=> https://toolset.com/consultant/

I hope I answered all your queries and thank you for understanding.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.