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:
Property | Type | Description |
---|---|---|
id | Integer | Unique identifier for the collection |
name | String | Display name of the collection |
description | String | Rich text description of the collection (can contain HTML) |
descriptionPlain | String | Plain text version of the description |
descriptionHtml | String | HTML version of the description |
slug | String | URL-friendly identifier for the collection |
collectionBGImage | String | Background image filename for the collection |
position | Integer | Order position for display (lower numbers appear first) |
expireDate | Date | Date when the collection expires (optional) |
publishedDate | Date | Date when the collection was published (optional) |
collectionType | String | Type of collection (e.g., "default") |
sortPreference | String | How content within the collection should be sorted (e.g., "most recent first", "chronological") |
PlatformId | Integer | ID of the platform this collection belongs to |
UserId | Integer | ID of the user who created this collection (optional) |
showOnHomepage | Boolean | Whether 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.