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
  • Overview
  • Content Type Fields
  • Under The Hood
  • Post Submission
  • Post Submission State
  • Validation
  1. Development
  2. Content Types

Selection Submission Action

PreviousPhoto Submission ActionNextShare Action

Last updated 5 years ago

Overview

The Selection Submission Action allows users to submit a text post via a form field displaying a predefined list of options.

Once the user submits the form, the block displays a post-submission state, showcasing the user's submission along with an editor defined label.

Content Type Fields

  • Internal Title: This is for our internal Contentful organization and will be how the block shows up in search results, etc.

  • Action ID: The Action ID associated with this action in Rogue.

  • Title (optional): The displayed title for the rendered card. (Defaults to "Make a selection").

  • Content: The content displayed in the card.

  • Selection Field Label (optional): The label displayed above the selection field. (Defaults to "Select one of the options below").

  • Selection Options: The full list of selection options, comma separated.

  • Selection Placeholder Option (optional): The placeholder selection value. This will not be a valid selection. (Defaults to "---").

  • Button Text (optional): Text to display on the submission button (defaults to "Submit").

  • Post Submission Label: The text displayed under the user selection, post submission.

Under The Hood

Post Submission

Post Submission State

We wrap the form in an Apollo-GraphQL component, querying Rogue for the user's posts filtered by the Action ID. If we find an existing post, we render the post submission state, otherwise, the form as usual. We err on the side of caution when it comes to displaying the form, so if the query returns an error, the user isn't blocked from form submission.

Validation

We validate the selection before submitting the form to ensure that it matches one of the defined list of selections. This can help prevent custom and/or nefarious submissions that someone might be inclined to finagle via dom manipulation.

The selection text is submitted using the Redux action to post to Rogue.

storePost
<select>
Example Selection Submission Action
Example Selection Submission Action Post Submission State