Card
A card is a reusable link to a NationBuilder page. Cards are displayed by the Card Carousel, Card Grid, Card Row, and Filter Grid modules.
The module decides which pages to load and how to arrange them. The shared Card element decides what content each page displays.
#Shared Card Content
| Card content | NationBuilder source |
|---|---|
| Title | Page headline, falling back to the page name |
| Description | Page excerpt, when one has been added |
| Image | Page meta image, when one has been added |
| Link | The page URL, unless the Basic page uses the layout:redirect override described below |
| Filter categories | Any page tags using the format filter:XXX |
The whole card is clickable. Cards without a meta image display as text-only cards, except that a redirect card can fall back to its first attached image.
Card Layout by NationBuilder Page Type
The card layout is inferred from the card page's parent page. This means the same shared Card element can render different information when a module loads pages from a Blog, Calendar, or Basic page.
| Page being rendered | Card output |
|---|---|
| Blog Post in a standard Blog | Meta image, headline, publication date, published author, excerpt, and “Read more” |
Blog Post in a Blog whose slug contains resources |
The Resource card layout: meta image, headline, publication date, published author, excerpt, and “Read more” |
| Event in a Calendar | Meta image, headline, event date and time, venue name, and excerpt. Multi-day events display a date range. |
| Basic page under a standard Basic parent page | Meta image, headline, excerpt, and “Read more” |
Basic page under a Basic parent whose slug contains resources |
The Resource card layout: meta image, headline, publication date, published author, excerpt, and “Read more” |
If a listed field is empty in NationBuilder, that field is omitted from the card. All standard cards link to the page they represent.
Basic Page Redirect Cards
Use a redirect card when a Basic page needs to appear in a card module but clicking it should go to a different internal page or an external website.
- Create and publish a Basic child page within the Basic page used as the card module's data source.
- Add the card's visible headline and excerpt to the child page.
- Put only the destination URL in the Basic page content.
- Add the page tag
layout:redirect. - Add a meta image if the card needs an image. If there is no meta image, the card uses the first image attachment it can find.
Supported destinations are:
- A root-relative internal path, such as
/our-vision - An absolute URL beginning with
https://orhttp://
The layout:redirect tag takes precedence over the normal page-type layout. The card still displays the Basic page's headline and excerpt, but its link is taken from the Basic page content.
External destinations open in a new tab. Internal paths and absolute URLs on the Better Taxes domain open in the same tab. If the Basic page content is empty or is not a supported URL, the card safely falls back to linking to the Basic page itself.
Ordering Basic Page Cards
Card modules use the following ordering rules when their data source is a Basic page:
- By default, published child pages are ordered from most recently published to oldest.
- If the parent Basic page has a configured Subnav, its Subnav pages become the card list and are displayed in that manual order.
Use the parent page's Subnav pages settings when cards need a curated order. Pages excluded from that configured Subnav are also excluded from the card list.