HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Custom Application not using default theme (theme-foundation) in titlebar or banner (v.3.3)
I created a custom application addon with React views. Everything is working as expected with the exception of the titlebar and banner. They appear to be ignoring the variables.neon settings. I'm thinking it has to do with my addon bootstrap file....
$container = Gdn::getContainer(); $container ->rule(Dispatcher::class) ->setShared(true) ->addCall('addRoute', ['route' => new Reference('@homepage'), 'homepage']) ->rule('@homepage') // Choose a name for our route instance. ->setClass(ResourceRoute::class) ->setConstructorArgs(['/homepage', '*\\%sHomepageController']) ->addCall('setMeta', ['CONTENT_TYPE', 'text/html; charset=utf-8']) ->addCall('setRootController', [HomepageController::class]);
Do I need to add something like this line that I see in the root bootstrap file?
->addCall('setThemeFeatureEnabled', [new Reference([ThemeFeatures::class, SearchRootController::ENABLE_FLAG])])
I haven't found any references to setThemeFeature or ThemeFeatures in the documentation.
2
Comments
Sorry, I do not understand that question, maybe because it is too React related... :-(
But ifyou want to know how to access settings from Vanilla like e.g the mobile title bar color and the banner logos, you need to access the config.
There are values like e.g.
in the config. In PHP you can access them with
Gdn::config('Garden.Logo')
and you would need to pass that to your view. Passing variables to views so that they can be used by Vanilla JavaScript code normally happens with Gdn_Controller->addDefinition(key, value), but since I do not know how you are working with your React views, passing variables might be totally different for you.