Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Joel R Posted December 9, 2016 Posted December 9, 2016 Hello IPS Devs, I noticed the "latest images" strip to preview albums on the Category Template does not honor the album's sort. This really is unideal, as images are intentionally sorted by caption on my site as they often tell a story, and the uploads can come out of order in terms of when they are uploaded. Can this possibly be resolved? foreach( \IPS\Db::i()->select( '*', 'gallery_images', array( 'image_album_id=? AND image_approved=1', $this->id ), 'image_date DESC', array( 0, 20 ) ) as $image ) \IPS\gallery\Album, line 744, method setLastImage That code should honor the album sort, or at least have an option to.
bfarber Posted December 9, 2016 Posted December 9, 2016 Personally, I think that's a different thing really. The "latest" image is always going to be the most recently added image. I'm not sure I agree that if you change the album sort it should change which image is the "latest". Similarly, showing the "latest images" in an album in a strip, it seems logical that this is always going to be the most recently uploaded images. I think in your case you would benefit from using a plugin to adjust the category page, as your site has a different use case, but "latest images" I think is a fairly straight forward concept that wouldn't typically vary from site to site.
Joel R Posted December 9, 2016 Author Posted December 9, 2016 The primary goal of the "preview strip" is meant to provide a preview of album content, right? And wouldn't you agree that the preview should summarize and capture the essence of the album as much as possible? And one of the more important characteristics of the album is the flow of imagery, so wouldnt it be reasonable that the preview strip should retain the image order? Order matters in imagery, just as order matters in forum discussions. Imagine previewing a forum discussion that randomly selects a jumbled sequence of posts, and trying to understand the coherent flow of discussion!
Marcher Technologies Posted December 9, 2016 Posted December 9, 2016 I would like to point out that there is no frontend indication that they are the 'latest images'. To the end user, it's just an image strip for the album, that does not match the actual album listing at all, provoking confusion. The field name and naming of variables in the code in question do not seem like valid reasons to take the stance taken in my opinion, as there is nothing that explicitly says 'these are the latest images' to the end user in the first place.
bfarber Posted December 12, 2016 Posted December 12, 2016 I should make sure it's clear that I'm stating my opinion, and not a company stance. I'm not looking at variables (I don't have the code open), I'm just speaking from the position that this is a strip of the latest images in a category/album, and it makes sense to me that they would always be the latest images, even if you wanted to order the images in an album differently when visiting it. I've seen many other galleries that might have specified order of images, but there's still somewhere a "here are the latest images uploaded" block or strip. Having said all of that....this is a development gateway forum where we try to help answer questions about developing for IPS4 or coordinating minor changes for IPS4 that would make your lives easier. What you are asking for is really a change to how one of our default features work and I'd suggest the Product Feedback forum is probably a better place for this discussion. Let me know if you'd like for me to move this topic.
Marcher Technologies Posted December 28, 2016 Posted December 28, 2016 Following up on this. First of all, regarding the default feature change, I agree it's better posted in feedback, and will also encourage the client to repost there. That said, I must pose the question. Considering there would be no other way to do this as a modification besides overloading the method, duplicating the code from within it, and changing minor parts, would that still violate the license agreement? Given any choice or alternative I would have done it in the modification and this topic wouldn't exist.
bfarber Posted December 29, 2016 Posted December 29, 2016 Which code would you like to see abstracted to make it easier to extend? We are working over time on making things like this easier to extend and change, so real-world examples of areas you want to change but have trouble with are useful.
Marcher Technologies Posted December 29, 2016 Posted December 29, 2016 40 minutes ago, bfarber said: Which code would you like to see abstracted to make it easier to extend? We are working over time on making things like this easier to extend and change, so real-world examples of areas you want to change but have trouble with are useful. \IPS\gallery\Album->setLastImage. Either a second parameter for the 'lastXImageSort' passed to this method and used in the query defaulting to the currently in use sort by date, or pulling the query itself out to it's own method to be modified before iterating would suffice. Note I speak of the select iterated through, not the counting queries. Thank you for following up.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.