Skip to main content

Collections Overview

Collections in Tribe Social are containers that group related content together. They provide a way to organize content into meaningful categories, making it easier for users to discover and consume related materials.

Collection Model

A collection in Tribe Social has the following key properties:

PropertyTypeDescription
idIntegerUnique identifier for the collection
nameStringDisplay name of the collection
descriptionStringRich text description of the collection (can contain HTML)
descriptionPlainStringPlain text version of the description
descriptionHtmlStringHTML version of the description
slugStringURL-friendly identifier for the collection
collectionBGImageStringBackground image filename for the collection
positionIntegerOrder position for display (lower numbers appear first)
expireDateDateDate when the collection expires (optional)
publishedDateDateDate when the collection was published (optional)
collectionTypeStringType of collection (e.g., "default")
sortPreferenceStringHow content within the collection should be sorted (e.g., "most recent first", "chronological")
PlatformIdIntegerID of the platform this collection belongs to
UserIdIntegerID of the user who created this collection (optional)
showOnHomepageBooleanWhether the collection should be displayed on the homepage

Collection Relationships

Collections have relationships with other entities in the system:

  • Platform: Each collection belongs to a specific platform
  • Contents: Collections contain multiple content items
  • Groups: Collections can be associated with specific groups
  • Ads: Collections can have associated advertisements
  • User: Collections are created by a specific user

Firebase Integration

Collections are synchronized with Firebase Firestore for use in the mobile application. When collections are created, updated, or deleted, the corresponding data is also updated in Firestore.

Collection Types

Collections can be of different types, with the default being "default". The collection type determines how the collection is displayed and behaves in the user interface.

Collection Sorting

Content within collections can be sorted according to different preferences:

  • Most recent first: Content is sorted by creation date, newest first
  • Chronological: Content is sorted by date in chronological order
  • Custom order: Content is manually ordered by position

Collection Visibility

Collections can be shown or hidden from the homepage using the showOnHomepage property. This allows for creating collections that are only accessible via direct links or through groups.

API Endpoints

The Collections API provides endpoints for managing collections, including:

  • Creating and updating collections
  • Retrieving collections by ID or slug
  • Listing collections for a platform
  • Retrieving a single public collection by ID (no authentication required)
  • Reordering collections
  • Deleting collections

See the individual endpoint documentation for more details on how to use these APIs.