District Core Developer DocsDistrict Core Developer Docs
Developers
Boilerplate
Modules
Bitbucket
Developers
Boilerplate
Modules
Bitbucket
  • Modules

    • ABN
    • ActivityLog
    • AnalyticsApi
    • ApiConnector
    • BlockApi
    • CategoryApi
    • CloneApi
    • CommentApi
    • ContentApi
    • Core
    • Documents
    • EmbedApi
    • Event
    • ExportApi
    • FeatureApi
    • FormApi
    • GTM
    • GalleryApi
    • HelpApi
    • Hotspot
    • IdeaSurvey
    • ImportApi
    • InteractionsApi
    • Intercom
    • MailApi
    • MapApi
    • MapSurvey
    • MediaApi
    • MenuApi
    • MetaTagApi
    • NlpApi
    • NotificationApi
    • Page
    • ParentableContent
    • PaymentApi
    • PermissionsApi
    • Postcode
    • ReCaptcha
    • Redirects
    • Renderer
    • ReportApi
    • RestrictionApi
    • RevisionApi
    • SearchApi
    • Settings
    • ShareableApi
    • Slack
    • SlugApi
    • SubscribableApi
    • Survey
    • Team
    • TenantApi
    • TestApi
    • ThemeApi
    • Timeline
    • TranslationApi
    • Update
    • Users
    • VisualisationApi
    • WorkflowApi
    • Wysiwyg

ContentAPI Module

The ContentAPI is a generic approach to storing content. It uses the FormApi to build and define forms, the RenderApi to render the submitted content and Bundle plugins to handle business logic.

What is a bundle

A bundle is a way of grouping logical functionality across ContentType models. Bundles are classes that implement BundleInterface and are linked directly to ContentType models so while the generic model can be used for storage, the bundle can provide the custom functionality.

Example of bundle usage

We have a bundle PublicNoticeBundle which handles dealing with public notices. It defines consistent schema, settings and functions that are required for a public notice submission, searching and viewing. There are different types of public notices (eg. Building, Roads, etc) all which will require different submission forms and ways of rendering the submissions, but they all share underlying core functionality provided by the bundle.

Another example could be a ParkBundle and it might have different forms for submitting different park types such as sports grounds, botanical parks, car parks, etc

Model types

The different model types are used to store content. Relationships flow downwards with each level having a link to what is defined before it. Bundle -> ContentType -> Content -> ContentData.

Bundle

Not a model but sits above ContentType

ContentType

This is a responsible for:

  • Association with a bundle plugin
  • The submission form definition
  • The way the submission will be rendered
  • Permissions around creating content of this type

Content

This is an individual piece of content, it is tied to a content type (and thus a bundle/form/render).

  • It is subject to workflow processes
  • It may be accessed via a single page view
  • It may be indexed and searched

ContentData

This is an individual submission form field value, it is almost never accessed directly or will it ever have its own page, it is the most granular part of the ContentApi

  • When a single input is inputted and saved via content type form it will create a content data model
  • Accessing content data is always via the content model and ContentDataService

Bundle specific settings

All ContentTypes belonging to a bundle


Edit this page
Prev
CommentApi
Next
Core