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

Renderer module

This module provides a Facade that can be used to render objects for different formats.

For Web rendering it uses InertiaJS, but by providing different FormatRenderers, it can generate other response types.

When a controller wants to generate a response, it should call the Renderer facade to generate the response.

use Modules\Renderer\Facades\Renderer;

...

return Renderer::render($content, 'TEMPLATE', Format::WEB);

The avaliable formats defined in the \Modules\Renderer\Plugins\FormatRenderers\Format enum and are used to find the correct renderer. The available formats are WEB, OFFICE and EMAIL.

The 'TEMPLATE' name is an identified used to locate the response template from the module. For Vue components for example the identifier name should be in the format: '~MyModule/Path/TemplateName'

The vue components will be resolved to the modules Resources/assets/js folder.

E.g. ~Cookie/Pages/Monster will resolve to Modules/Cookie/Resources/assets/js/Pages/Monster.vue

A theme can override the template from a module by placing a matching template in it's own resources folder.

E.g. the base theme could override the example with a template at

themes/base/js/Modules/Cookie/Pages/Monster.vue

Pages and Components should be used to split templates between entire pages, and components to be used within pages.

All modules have an alias generated matching the module name so that components can be included from other template using the alias.

E.g.

import ContentType from "~ContentApi/Components/ContentType";

Edit this page
Prev
Redirects
Next
ReportApi