Inicio - Documentación - POM Theme - 08 Templates - Build a feed template

Build a feed template

A feed template defines the HTML for one repeated result. Use it for archive cards, author and search results, faceted results or a Listings (Feed) element.

Before you begin

Choose one real item that contains the fields the card must display. Also prepare an item with missing optional data so empty wrappers can be tested.

Create the template

  1. Open Settings → POM Theme → Templates → HMTL templates → Feed HTML templates.
  2. Select Add feed template.
  3. Enter a clear Template name.
  4. Build one item in Template HTML.
  5. Add feed merge tags for the image, title, URL and supporting data.
  6. Add conditional blocks around optional custom fields.
  7. Select any required Custom CSS Stylesheets and Custom JS Scripts.
  8. Save the theme settings.

Example:

<article class="event-card">
    <a href="{{permalink}}">
        {{featured_image image_size="medium_large"}}
        <h2>{{title}}</h2>
    </a>

    {{if meta="event_date" value="not_empty"}}
        {{meta name="event_date" type="date" prepend=%%Date: %%}}
    {{/if}}

    <p>{{excerpt limit="140"}}</p>
</article>

Assign the card

For a theme archive, author page or search result:

  1. Open its settings under Settings → POM Theme → Templates.
  2. Select the template under Custom result template.
  3. Choose a Results wrapper or equivalent result layout.
  4. Configure its columns where those controls are available.
  5. Save and open the public results page.

For a Listings (Feed) element, select the template directly in that element's result-template setting.

Understand wrapper versus item

The wrapper decides how multiple items are arranged. The feed template decides what one item contains. If the template already supplies all required outer structure, choose No wrapper (set your own on your archive and feed templates) where that option is available.

Verify the result

  • Test one, several and no results.
  • Check a card with a long title and excerpt.
  • Check a card without an image or optional custom field.
  • Confirm links open the correct item.
  • Verify the selected column and responsive layout settings.

A minimal title-only card usually means that no usable custom result template was resolved for that context.

Related guides