Search by

ernestdefoe / postcards

ernestdefoe

Postcards: the discussion list as cards. The first picture or video of each discussion on the front, the author's avatar over it, an excerpt and the counts below. Grid, masonry or wide, per tag, with uploaded tag covers and a built-in view counter.

Package info

github.com/ernestdefoe/postcards

Type:flarum-extension

pkg:composer/ernestdefoe/postcards

Fund package maintenance!

Other

Statistics

Installs: 17

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.3 2026-12-01 15:28 UTC

This package is auto-updated.

Last update: 2026-12-02 02:23:40 UTC


README

The discussion list as cards. Each discussion's first picture or video is on the front, with the author's avatar sitting on its edge. Below it are the title, tags, a short excerpt, and the reply and view counts.

Free, MIT, for Flarum 2.

The discussion list as masonry cards

What it does

  • Three layouts:
    • Masonry (the default) keeps each picture's own shape.
    • Grid gives every card the same shape.
    • Wide puts one card on each row, with the picture on the left.
    • Phones always get one column with compact covers.
  • The cover is the first picture or video of the first post:
    • a picture in the post, or one uploaded with fof/upload;
    • a YouTube video shows its thumbnail and a play badge. Nothing is fetched to make it.
    • a discussion linked to a movie, show, game, book or album with Marquee shows that title's poster (or its wide backdrop on phones, Grid and Wide), ahead of a picture in the post.
    • A picture inside a spoiler is never used, and neither is spoiler text in the excerpt.
  • Tag covers: upload a cover for any tag. Choose whether it's used only when a discussion has no picture or video of its own, or always, instead of the post's.
    • There's also a forum-wide default cover.
    • If there's no cover at all, the card shows its tag's color and the first letter of the title. A card never shows a broken image.
  • Per tag: turn cards on or off for a tag, and pick its layout.
  • Members choose: a button above the list switches between cards and the classic list. The choice is remembered for each member. Admins can turn the button off.
  • View counts built in. Each viewer counts once per discussion per half hour, crawlers and the author don't count, and no IP address is stored.
    • If FoF Discussion Views or michaelbelgium's Discussion Views is enabled, cards show its count and Postcards' own counter stops.
    • Admin → Tools can import their totals.
  • A lead card, if you want one: the first sticky discussion, or simply the first, spans the full width.
  • Works with themes and other extensions:
    • Cards follow your colors and dark mode.
    • Badges, tags and what other extensions add to the list (best answer, polls…) show on the cards.
    • Postcards steps aside on themes that draw their own list (Cascade, Studio, Broadsheet and Warren).

How it stays light

  • The cover and excerpt are picked once, when the first post is saved, and stored. Reading the list parses nothing and costs one extra query per page, whatever the number of discussions.
  • There are no image copies to generate and nothing to regenerate after you install it. Pictures load lazily at their real size.
  • The forum script is about 3.5 KB gzipped.

Install

composer require ernestdefoe/postcards
php flarum migrate
php flarum cache:clear

Enable it in the admin panel. Existing discussions get their covers in the background, 200 at a time.

On a big board, you can also run:

php flarum postcards:rebuild

The view counter forgets who viewed what after an hour, with a scheduled task. Make sure Flarum's scheduler runs (a cron entry for php flarum schedule:run).

Support

Questions and bug reports: ernestdefoe.online.

If Postcards is useful to you, you can buy me a coffee.