> ## Documentation Index
> Fetch the complete documentation index at: https://docs.digifist.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Template (main-search)

> Configure your search results page with product grid, blog results, and page results display options

The Search template (main-search) controls how search results display, combining products, blog articles, and pages with filtering and customizable metadata display.

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/digifist/images/theme/mojave/main-search-overview.png" alt="Search results page overview" />
</Frame>

## What this section controls

* Product grid layout and density
* Product filtering and sorting
* Blog article result display with metadata
* Page result display options
* Results per page pagination
* Label and tag display for mixed results

## Getting started

<Steps>
  <Step title="Open Theme Customizer">
    In your Shopify admin, go to **Online Store > Themes** and click **Customize** on your active theme.
  </Step>

  <Step title="Navigate to search page">
    Use the page selector dropdown to select **Search** or perform a search on your live site.
  </Step>

  <Step title="Locate the template">
    The "Search" section controls the search results template.
  </Step>
</Steps>

## Template settings

<Tabs>
  <Tab title="Grid Layout">
    <AccordionGroup>
      <Accordion title="Products per row - Mobile">
        Control product grid columns on mobile (1-2 products, default: 2).

        Same as collection page - 2 columns recommended for balanced browsing.
      </Accordion>

      <Accordion title="Products per row - Desktop">
        Control product grid columns on desktop (2-4 products, default: 4).

        4 columns maintains consistency with collection pages and efficient browsing.
      </Accordion>

      <Accordion title="Items per page">
        Total items (products + articles + pages) before pagination (4-48 items, default: 24).

        **Note**: Mixed result types - 24 items might be 20 products, 3 articles, 1 page.
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Filtering & Sorting">
    <AccordionGroup>
      <Accordion title="Enable filtering">
        Shows product filtering controls (enabled by default). Filters managed through Search & Discovery app.

        **Mixed results behavior**: Filters only apply to products, not blog articles or pages.
      </Accordion>

      <Accordion title="Enable sorting">
        Shows sorting dropdown for products (enabled by default). Standard sort options apply.

        **Note**: Sorting affects product results only.
      </Accordion>

      <Accordion title="Show in sidebar on desktop">
        Moves filters to sidebar on desktop (disabled by default - uses horizontal bar).

        Same options as collection page.
      </Accordion>

      <Accordion title="Filters style">
        Square or round filter buttons (default: square). Only applies to horizontal bar layout.
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Blog Article Results">
    <AccordionGroup>
      <Accordion title="Show labels">
        Controls label display for blog articles in search results:

        * **Show blog post label** (default): Displays "Blog post" badge
        * **Show tags**: Displays article tags instead
        * **Show none**: No labels

        Helps distinguish blog articles from products and pages in mixed results.
      </Accordion>

      <Accordion title="Tags display count">
        When showing tags:

        * **Show all** (default): All article tags
        * **Show first**: First tag only
      </Accordion>

      <Accordion title="Show excerpt">
        Display article preview text (disabled by default). Helps users decide relevance.
      </Accordion>

      <Accordion title="Show date">
        Display article publish date (enabled by default).
      </Accordion>

      <Accordion title="Show author">
        Display article author name (enabled by default).
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Page Results">
    <AccordionGroup>
      <Accordion title="Show page label">
        Display "Page" badge on page results (enabled by default).

        Distinguishes standard pages from products and articles.
      </Accordion>

      <Accordion title="Show page excerpt">
        Display page content preview (disabled by default).

        Enable to help users identify relevant pages quickly.
      </Accordion>

      <Accordion title="Show page read more">
        Display "Read more" link on pages (enabled by default).

        Provides explicit call-to-action for page results.
      </Accordion>
    </AccordionGroup>
  </Tab>
</Tabs>

## Search result types

The search template displays three types of results in mixed format:

**Products**: Displayed in grid matching collection pages, with images and purchase options.

**Blog articles**: Card format with optional metadata (date, author, excerpt, tags).

**Pages**: Simple list format with title, optional excerpt, and "Read more" link.

**Result ordering**: Shopify's search algorithm determines relevance and ranking across all result types.

## Best practices

<CardGroup cols={2}>
  <Card title="Keep labels enabled" icon="tag">
    Show "Blog post" and "Page" labels to help users distinguish different content types in mixed results.
  </Card>

  <Card title="Enable article excerpts" icon="align-left">
    Turn on blog excerpt display - helps users quickly determine article relevance from search results.
  </Card>

  <Card title="Match collection settings" icon="grid">
    Use same product grid settings (4 columns, filtering, sorting) as collection pages for consistency.
  </Card>

  <Card title="Show article metadata" icon="calendar">
    Keep date and author enabled for blog results - provides context about content freshness and source.
  </Card>

  <Card title="Enable page excerpts" icon="file-lines">
    Consider enabling page excerpts if you have many pages - helps users identify right page in results.
  </Card>

  <Card title="Test mixed results" icon="magnifying-glass">
    Search for terms that return products, articles, and pages to ensure all result types display correctly.
  </Card>

  <Card title="Optimize items per page" icon="list">
    24 items balances browsing with performance. Adjust if users frequently paginate or complain about slow loading.
  </Card>

  <Card title="Configure search filters" icon="filter">
    Use Search & Discovery app to customize which product filters appear on search results.
  </Card>
</CardGroup>
