Adding new images to first or last page in Paginated Gallery

Hi Everyone,
I have a thumbnail gallery that is paginated (divided into several pages).

For example:
Page 1: 30 images
Page 2: 30 images
Page 3: 24 images

Now, if I want to add one new image, logically I would add it to Page 1 because that’s the start/main page.
In that scenario, I would have to move 1 image from page 1 to page 2, then move 1 image from page 2 to page 3.
Add on that, I would have to do the same in Image Sitemap and resubmit every time.
Images will lose Index and the whole process is time consuming.

Are there any other options apart from adding new images to the last page? whats the secret here, cant think of anything else really.

How are you generating these thumbnail gallery pages, manual html or some back-end scripting and database?
If it’s generated dynamically from the back-end, that should handle it, if it’s all done manually, then you should consider setting up a database and some scripts server-side to do the work for you.

I’m curious as to why you’ve tagged this topic SEO. How would the positioning of a new thumbnail be relevant to SEO?

You are now finding out why code like php is useful :sunglasses:

With php you could do it without a database by either reading the EXIF data, upload/creation time or if you numbered your photos in order use that.

I would guess a database would be a bit quicker for lots of photos.

1 Like

Yes, you don’t need a database, but it’s probably the best way to go to manage and organise a gallery.
Most hosts offer PHP and MySql, so it should be available, then it’s just know-how.

@SamA74 Manual HTML is the answer. I don’t mind learning a side server language, but I cant really imagine how it gonna be done. Will it be like, adding a cell in a table to page 1 then it automatically moves images to other pages to preserve 30 images per page? what should i search for?

@TechnoBear its about the Large image that the thumbnail leads to. If i move 1 image from a page to another, I guess google will remove it from Image Search because in its eyes the image have been deleted from that page. Also, it would take some time to re-index this image because i just added it to another image. Something like that.

@Rubble I am not quite sure what you mean by all that. Images are numbered. Whats that technique is called?

You read the images from the folder into an array and sort the array in reverse order and then generate the page.

It is still pagination but the code is generated automatically; that is how I built these pages but using a databse: https://rubblewebs.co.uk/imagemagick/operators/operators.php?page=1#Adaptive_blur

EDIT:
You could write the code yourself but in the end I plumped for a class I found online: zebra pagination

As you can see on my site I use a database and include a title, information, image and code.

I used to use the array method in a gallery before I started including more information.

To be honest, if you have no experience with server-side code, it may be a steep learning curve, but not beyond any reasonably intelligent person, it just may seem to take some time and effort to get there. But in the long term worthwhile.
PHP is considered a relatively easy language for beginner to pick up.

To begin with you can just add entries to the database manually, and the scripting will sort out the pagination and html output. In the longer term you could set up a admin thing to manage the gallery via forms. Or you could have a script that checks the content of a folder you upload images to and automatically adds them to the database and/or gallery (similar to what @Rubble suggests).
The possibilities are endless. But it can work however you want it to work, that’s what scripting is all about.

If you are having trouble keeping up with editing 3 files to shift items now, imagine how much it would take as the number of pages grow.

IMHO, hard coding pages can be OK as long as they change only rarely or not at all. What you are describing does not meet that criteria.

Where code shines is doing tasks that are tedious and repetitive. In fact as soon as I find myself doing something time consuming one of the questions I ask myself is if it might be worth it to write script to do it for me or if I’m willing to slog it out. In the short term, putting the script together is a bit more work. But in the long term it will save work.

Even if you don’t want to use a database I recommend you at least consider using a CSV file so that only the one file would need to be edited. I like the idea of having script getting images from the images folder too

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.