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();

    ->addCall('addRoute', ['route' => new Reference('@homepage'), 'homepage'])

    ->rule('@homepage') // Choose a name for our route instance.
    ->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.


  • R_JR_J Ex-Fanboy Munich Admin

    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.

    $Configuration['Garden']['MobileAddressBarColor'] = '#00ff00';
    $Configuration['Garden']['Logo'] = '3bf616c212e7fb8fa69cdbb707738dac.png';
    $Configuration['Garden']['MobileLogo'] = '1a49d5f5fe98aac31c391227929a24c3.png';

    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.

Sign In or Register to comment.