JoomGalleryfriends / JG4-dev

Development repository for JoomGallery v4.x
GNU General Public License v3.0
10 stars 6 forks source link

Frontend cleanup and category view #217

Closed Elfangor93 closed 1 month ago

Elfangor93 commented 2 months ago

Frontend cleanup

The code style and coding notes of the frontend PHP files are improved and cleaned up. Additionally, all easy to replace deprecations are replaced like Factory::getDbo; with Factory::getContainer()->get(DatabaseInterface::class);.

Category view

It introduces a menu item parameter for the category view which allows to override the number of images loaded. If Use Pagination is set to No, all images are loaded independently what was chosen in the list.limit filter.

grafik

And there is now a json endpoint for the category view in order to retreive category info and image thumbnails via JavaScript requests (ajax). This is useful for frontend javascript functionalities like a "load more" button.

Request grafik

Respond grafik

Elfangor93 commented 2 months ago

@reilldesign Is there anything else you need to continue the category view in the frontend?

Btw, you can choose how many images you wanna get in the category view by adjusting the list[limit] request variable. If you set list[limit] = 0 you get all the images from the category. With list[limit] = 20 you a bunch of maximum 20 images. With the limitstart variable you can adjust which should be the first image loaded. E.g use limitstart = 0 to load the first bunch of images, and limitstart = 5 to start with 5th image onward. With the list[fullordering] variable you can choose the ordering of the image. Default is list[fullordering] = a.ordering ASC. This means that the images are ordered based on the ordering in the backend in ascending direction. You could also order the images by date by using list[fullordering] = a.date DESC to get the newest images first.

I hope this helps for your further development of the category view.

reilldesign commented 2 months ago

@Elfangor93 Thank you for the pagination option. I will continue working on the frontend next week. If I need further options I will let you know. Should I make my additions to this pull request or create a new one?

reilldesign commented 2 months ago

The Joomla pagination is not displayed and the following code is ignored:

<?php // Show images pagination echo $this->item->images->pagination->getListFooter(); ?>

Elfangor93 commented 1 month ago

Close this since it is now part of PR #224