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

ThemeAPI module

The ThemeApi provides functionally, dependencies, configuration and routes that assist with theming.

The most notable functionality provided is the /styleguide/** routes that renders key components, palettes and styles so they can be reviewed and provide usage examples.

Adding blade components to regions

Your module might need to inject a blade template in the layout. Eg script tags for GTM, Intercom, etc. If so, your module just needs to register this addition in its service provider register() method.

Example of registering browsersync on dash & frontend just before the closing body tag.

public function register()
{
    parent::register();
    
    LayoutService::registerRegionComponent(
        LayoutSections::ALL, // section to register (all, dash, frontend)
        LayoutRegions::POST_BODY, // where in the layout (head_scripts, post_body, etc)
        ['themeapi::browsersync'] // What components get added.
    );
}

TODO

This module should be responsible for qirolab/laravel-themer configuration, middleware and anything else to do with theme switching. With a minor amount of refactoring this did not go smoothly and needs more time. Once this gets sorted this text should be removed and replaced with information on how to switch themes.


Edit this page
Prev
TestApi
Next
Timeline