Phoenix Documentation
Phoenix ProductionPhoenix PreviewContentful
Primary version
Primary version
  • 🔥Phoenix 🔥
  • Installation + Usage
    • Prerequisites
    • Installation
    • Usage
  • Development
    • Architecture
      • Heroku
    • Content Types
      • Action Stats Block
      • Campaign
      • Content Block
      • Cause Page
      • Company Page
      • Current Club Block
      • Current School Block
      • Embed
      • External Link
      • Landing Page
      • Link Action
      • Metadata
      • Page
      • Photo Submission Action
      • Selection Submission Action
      • Share Action
      • Signup Referrals Block
      • Social Drive Action
      • Voter Registration Action
      • Voter Registration Drive Action
      • Voter Registration Marketing Page
      • Voter Registration Referrals Block
    • Features
      • Affiliate Opt In
      • Affiliate Scholarship Block
      • Analytics Waypoint
      • Delayed Element
      • Dismissable Element
      • Stat Card
      • General Buttons
      • Groups
      • Paginated Campaign Gallery
      • Popover Dispatcher
      • Refer A Friend
      • Referrals Gallery
      • Sitewide Banner
      • Sixpack A/B Testing
        • Code Tests
        • Contentful Tests
        • Testing Tips
      • Tooltip
      • Traffic Distribution
      • Volunteer Credits
      • Voter Registration
      • Zendesk Form
    • Contentful
      • Workflow
      • Content Management API Scripts
    • Helpers
  • Phoenix API
    • v2
      • Campaigns Resource
      • Posts Resource
      • Zendesk Endpoint
  • Data + Performance
    • Monitoring
    • Analytics
    • Logging
  • Contributing Instructions
    • Edit This Documentation
    • Glossary
Powered by GitBook
On this page
  • Hide Campaigns
  • Algolia Campaigns Search
  • Usage Instructions
  1. Development
  2. Features

Paginated Campaign Gallery

The PaginatedCampaignGallery component will display a paginated gallery of 'website' campaigns queried via GraphQL.

Hide Campaigns

Group Campaigns (Campaigns with a group_type_id field assigned), will not be displayed in the gallery. Additionally, a custom list of Campaign IDs can be assigned via the DS_HIDE_CAMPAIGN_IDS site config variable, and Campaigns with matching IDs will also be rejected.

Algolia Campaigns Search

If the DS_ENABLE_ALGOLIA_CAMPAIGNS_SEARCH feature flag is enabled, the gallery will utilize the searchCampaigns GraphQL query to fetch the campaigns via Algolia.

Usage Instructions

The PaginatedCampaignGallery accepts a list of variables used to optionally filter and sort the campaigns:

  • An array of causes Strings to filter for campaigns including the listed causes

  • an isOpen Boolean to determine filtering for open or closed campaigns

  • an orderBy (comma separated) String to program the sorting ('id,desc')

  • a first integer to determine how many campaigns to pull at a time

Additionally, it accepts a couple of gallery specific props:

  • itemsPerRow

  • (optional) title

<PaginatedCampaignGallery
    className="grid-full"
    itemsPerRow={4}
    title="Campaigns"
    variables={{ isOpen: true, first: 12, causes: [slug] }}
/>
PreviousGroupsNextPopover Dispatcher

Last updated 4 years ago

Example paginated campaign gallery