? Pending

User tests: Successful: Unsuccessful:

avatar rajkumaar23
rajkumaar23
12 Jan 2020

Pull Request for Issue #26881

Summary of Changes

  • Appends a limitstart param to the action on pagination links

Testing Instructions

  • Ensure the pagination doesn't break with this PR.
  • Verify if limitstart param is appended & modified while paginating.
  • Check if proper page is rendered when limitstart is modified in address bar.

Expected result

Actual result

Documentation Changes Required

NIL

avatar rajkumaar23 rajkumaar23 - open - 12 Jan 2020
avatar rajkumaar23 rajkumaar23 - change - 12 Jan 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Jan 2020
Category Layout
avatar rajkumaar23 rajkumaar23 - change - 12 Jan 2020
Title
Pagination seo friendly
[4.0] Pagination seo friendly
avatar rajkumaar23 rajkumaar23 - edited - 12 Jan 2020
avatar Quy
Quy - comment - 12 Jan 2020

Please revert coding style changes per Joomla! Coding Standards.

avatar rajkumaar23
rajkumaar23 - comment - 12 Jan 2020

Please revert coding style changes per Joomla! Coding Standards.

Okay sure, Can you let me know how to populate the pages that use pagination? Because I don’t seem to have enough data to paginate.

avatar Quy
Quy - comment - 12 Jan 2020

Try installing Testing Sample Data. Then do a search on the frontend.

avatar rajkumaar23 rajkumaar23 - change - 12 Jan 2020
Labels Added: ?
avatar rajkumaar23 rajkumaar23 - change - 12 Jan 2020
The description was changed
avatar rajkumaar23 rajkumaar23 - edited - 12 Jan 2020
avatar rajkumaar23
rajkumaar23 - comment - 12 Jan 2020

Thanks @Quy ! I was able to test with the dummy data and I've reverted as per coding standards and fixed another bug in the PR too.

avatar rajkumaar23
rajkumaar23 - comment - 12 Jan 2020

@Quy Could you please review this PR ?

avatar ChristineWk ChristineWk - test_item - 12 Jan 2020 - Tested unsuccessfully
avatar ChristineWk
ChristineWk - comment - 12 Jan 2020

I have tested this item ? unsuccessfully on 81a7296

When going to i.e. page 2 (on pagination link) I get error 404.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27489.

avatar rajkumaar23
rajkumaar23 - comment - 12 Jan 2020

@ChristineWk Can you please check now ?

avatar ChristineWk ChristineWk - test_item - 12 Jan 2020 - Tested unsuccessfully
avatar ChristineWk ChristineWk - test_item - 12 Jan 2020 - Tested successfully
avatar ChristineWk
ChristineWk - comment - 12 Jan 2020

I have tested this item successfully on e3a52e5

Error 404 has gone. On 2nd page > in address bar I see: blog?limitstart=5


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27489.

avatar Hackwar
Hackwar - comment - 12 Jan 2020

I agree that the initial issue is a bug, but I don't understand why the method from J3 isn't still used. Can someone please explain why we should do it this way?

avatar Fedik
Fedik - comment - 12 Jan 2020

I am sorry to say, but the fix are wrong, such JavaScript hacking not acceptable

avatar rajkumaar23
rajkumaar23 - comment - 13 Jan 2020

I am sorry to say, but the fix are wrong, such JavaScript hacking not acceptable

Since the pagination itself is done via Javascript, I couldn’t think of any other way to update the URL with the limitstart value. Could you suggest a better idea?

avatar rajkumaar23
rajkumaar23 - comment - 13 Jan 2020

I agree that the initial issue is a bug, but I don't understand why the method from J3 isn't still used. Can someone please explain why we should do it this way?

Can you please let me know how it was done in J3 ? I’m new to Joomla! and I checked the branches here, and everywhere it’s done in JavaScript only.

avatar SharkyKZ
SharkyKZ - comment - 13 Jan 2020

In J3 frontend template had an override without JS in it.

Maybe in 4.0 we could do the other way around, make it JS-free by default and add an override for backend template instead.

avatar rajkumaar23
rajkumaar23 - comment - 13 Jan 2020

I guess then the complete pagination code has to change if it has to be no-JS. All I’ve done is append the limitstart param to the form action, added to the already existing JS code that modifies the hidden limitstart field in the form and triggers it. As far as this issue is concerned, the task was to make different URLs render different content.

avatar Fedik
Fedik - comment - 13 Jan 2020

You put all your "multi-line" javascript code in to oneclick attribute, do not do this ever.
Also please check how the form element works, you no need javascript to append a value that already there (use appropriate submit method GET/POST)

About correct fix, the pagination need to be a list of links, for frontend.
That @SharkyKZ already said

avatar rajkumaar23
rajkumaar23 - comment - 13 Jan 2020

@Fedik I'm sorry, but I couldn't understand what you're trying to say. If I'm not wrong, do you mean all this pagination forms has to be GET, so the URL will have limitstart appended automatically ?

avatar Fedik
Fedik - comment - 13 Jan 2020

Pagination should be a list of links, without javascript, without form.

avatar rajkumaar23
rajkumaar23 - comment - 13 Jan 2020

Pagination should be a list of links, without javascript, without form.

@Fedik Okay, so you mean to say the current implementation for pagination has to be changed to links. I thought that was out of scope for the related issue. I'll check how to do it.

avatar Fedik
Fedik - comment - 13 Jan 2020

Check @SharkyKZ comment, it should be changed only for the site, and stay unchanged for administrator.

avatar rajkumaar23
rajkumaar23 - comment - 13 Jan 2020

Check @SharkyKZ comment, it should be changed only for the site, and stay unchanged for administrator.

Sorry! I'm new to Joomla! Can I get some guidance on what's the override he was talking about ?

avatar SharkyKZ
SharkyKZ - comment - 13 Jan 2020

Templates support layout overrides. You can copy layouts/joomla/pagination/link.php to templates/cassiopeia/html/layouts/joomla/pagination/link.php to create an override for frontend template and remove JS code there.

Or the other way around, copy the file as-is to backend template: administrator/templates/atum/html/layouts/joomla/pagination/link.php and then edit original file to remove JS code.

There are other alternatives to consider like creating multiple standard layouts and making them configurable in pagination calls.

avatar joomla-cms-bot joomla-cms-bot - change - 13 Jan 2020
Category Layout Layout Front End Templates (site)
avatar rajkumaar23
rajkumaar23 - comment - 13 Jan 2020

@SharkyKZ Can you please check my latest commit if I've correctly understood what you told ?

avatar rajkumaar23
rajkumaar23 - comment - 13 Jan 2020

@Fedik I think now everything is sorted.

avatar Fedik
Fedik - comment - 13 Jan 2020

Now it looks much better than first version of it ?
Left only a testing, I guess.

avatar brianteeman
brianteeman - comment - 13 Jan 2020

I am coming to this late but to me it is crazy that we need to create an override. If we can't make the core work with the default templates that it ships with there is something very wrong

avatar rajkumaar23
rajkumaar23 - comment - 13 Jan 2020

I am coming to this late but to me it is crazy that we need to create an override. If we can't make the core work with the default templates that it ships with there is something very wrong

Alright then, does having the start param in URL on administrator routes cause any issue? If not, I don’t think this override is required. I can edit the original link.php, but as I was told in this thread that only frontend needs to have that param in the URL, override was the only possible way

avatar brianteeman
brianteeman - comment - 13 Jan 2020

Why does it have to be the same layout for both site and admin?

avatar rajkumaar23
rajkumaar23 - comment - 13 Jan 2020

I didn’t get you @brianteeman :(

avatar Fedik
Fedik - comment - 13 Jan 2020

@brianteeman there was comment @SharkyKZ suggested to make "this" as default, and then make override for admin template (should be simple), or make them configurable in pagination calls to use different layout depend from needs (this more advanced topic).

Admin use different pagination to keep adminForm "state". The form has extra fields, like CSR token, option, view etc, and can have more depend from component. As far as I know.

avatar brianteeman
brianteeman - comment - 13 Jan 2020

My view is that it should be

or make them configurable in pagination calls to use different layout depend from needs

avatar rajkumaar23
rajkumaar23 - comment - 14 Jan 2020

@Fedik What do you think could I possibly do to fix this ?

avatar Fedik
Fedik - comment - 14 Jan 2020

It is good as it is for now, it fixes the issue.

What was suggested is much complex work to do, and can be done any time later.

avatar brianteeman
brianteeman - comment - 14 Jan 2020

Unless I am very much mistaken it is not complex at all
See #27516 for a very quick example

avatar Fedik
Fedik - comment - 14 Jan 2020

I think we have a different look on what is "configurable pagination" ?

With your suggestion it still not possible to use simple links in backend, or javascript version on front end. It hardly can call "configurable".

The Pagination class allow to specify the layout, that allow to have 2 (an more) different layout at same time

*/
public function getPaginationLinks($layoutId = 'joomla.pagination.links', $options = array())
{
// Allow to receive a null layout
$layoutId = $layoutId ?? 'joomla.pagination.links';
$list = array(

A complexity here is to check all call of $pagination->getPaginationLinks() (both admin/site side) and adjust it to use specific layout, and make sure all works.

avatar brianteeman
brianteeman - comment - 14 Jan 2020

I think we have a different look on what is "configurable pagination" ?

Maybe so but my PR resolves the issue in the original report without creating template overrides

avatar Fedik
Fedik - comment - 14 Jan 2020

yeap, that also ok, I don't mind

avatar brianteeman
brianteeman - comment - 14 Jan 2020

as i said before

I am coming to this late but to me it is crazy that we need to create an override. If we can't make the core work with the default templates that it ships with there is something very wrong

avatar rajkumaar23 rajkumaar23 - change - 14 Jan 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-01-14 14:51:05
Closed_By rajkumaar23
avatar rajkumaar23 rajkumaar23 - close - 14 Jan 2020

Add a Comment

Login with GitHub to post a comment