selected catalog layout (grid/list) not saved

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
columbo
Advanced
Posts: 128
Joined: 09 Oct 2019, 09:42

selected catalog layout (grid/list) not saved

Post by columbo » 29 Jan 2022, 10:16

Hi

I customized two catalog layouts (-grid and -list) and updated in shop.php 'template-body-list' and 'template-body-grid'.
Now:
  1. on catalog list page: select list-layout (displayed in grid-layout first)
  2. go to product detail page
  3. go back to catalog list page: displayed in grid-layout (instead list-layout)
or:
  1. on catalog list page: select list-layout (displayed in grid-layout first)
  2. go to another category page: displayed in grid-layout (instead list-layout)
The previously selected layout has not been saved

Thanks!

User avatar
aimeos
Administrator
Posts: 7950
Joined: 01 Jan 1970, 00:00

Re: selected catalog layout (grid/list) not saved

Post by aimeos » 31 Jan 2022, 15:11

That's true, the "l_type" parameter doesn't get added to the generated URLs at the moment. Think, we can change that by adding "l_" as parameter that should be passed to the link view helper.

But this doesn't mean, the list view will be always used. If you e.g. click on the basket and then back to a category, the "l_type" parameter won't be passed then as well. We also don't want so store the parameter in the session because this makes caching of the HTML impossible.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

columbo
Advanced
Posts: 128
Joined: 09 Oct 2019, 09:42

Re: selected catalog layout (grid/list) not saved

Post by columbo » 02 Feb 2022, 21:26

but according to https://aimeos.org/docs/2020.x/config/c ... ate-header
...The type of the view is determined by the "l_type" parameter (allowed characters for the types are a-z and 0-9), which is also stored in the session so users will keep the view during their visit...
Doesn't that mean that a selected view layout should be displayed throughout the session?

or as an alternative:
Would it be possible to save the layout setting as a cookie, for example?

= = =

I tried to add the "l_type" parameter in /catalog/lists/items-body-grid.php the but failed.
Could you please provide some tips how to solve it?

Thank you!

User avatar
aimeos
Administrator
Posts: 7950
Joined: 01 Jan 1970, 00:00

Re: selected catalog layout (grid/list) not saved

Post by aimeos » 04 Feb 2022, 14:47

We've tried to improve the situation in 2021.10.x-dev and keep the parameters at least while using the filter options. You can test yourself after executing:

Code: Select all

composer req aimeos/ai-client-html:2021.10.x-dev
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

columbo
Advanced
Posts: 128
Joined: 09 Oct 2019, 09:42

Re: selected catalog layout (grid/list) not saved

Post by columbo » 07 Feb 2022, 21:13

As I'm using 2020.10 I added your code changes from
https://github.com/aimeos/ai-client-htm ... 8774d20511 and https://github.com/aimeos/ai-client-htm ... 5fc6d78205 accordingly.

It works, thank you!

But - as you already mentioned - only while using the filter options; Not when clicking the breadcrumbs or when returning from a product detail page.

Wouldn't it be possible and also usefol to store the layout setting in the session or as a browser cookie?

thanks again!

User avatar
aimeos
Administrator
Posts: 7950
Joined: 01 Jan 1970, 00:00

Re: selected catalog layout (grid/list) not saved

Post by aimeos » 08 Feb 2022, 11:09

Like said, this would make caching impossible because the output then depends on session or cookie content and the same URL returns different results.

Please also note that 2020.10 doesn't get updates for free any more (only with ELTS subscription):
- https://aimeos.org/roadmap
- https://aimeos.com/support#c428
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply