Menu

1 / 2

Numbering photos is easy. Letting people reorder them is not

DEV Community: laravel·Matt·about 4 hours ago
#CSkEvWaa
#devtolaravel#devto#dev#order#grid
Reading 0:00
15s threshold

I run Boat Build Log , a free site where people building a boat at home keep a dated log of the work: a few paragraphs, a handful of photos, repeat for two years. It's a Laravel app with server-rendered Blade and small plain JavaScript files, no framework on the front end.

This post is about a feature that sounds like an afternoon's work: let a builder put the photos on an entry in order, and number them. It took three commits, one embarrassing CSS bug, and it only exists because an import went wrong.

Why the photos needed numbers

A builder moved his log over from his own website. On his old site every page was a column of photos with a caption under each one. After the import, each entry was one block of text followed by a grid of pictures. All the captions had run together and nothing said which note went with which photo.

He wrote to me, quite reasonably, and asked how a reader was supposed to know that "fitting the sheer clamps" was the fourth picture and not the fifth.

The cheap fix was a number.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.