Setting default theme in AWAB Dev edition?

1737
1
02-11-2016 12:12 PM
NathanEnge
Esri Contributor

Hi

I've created a custom theme pack called BCGovTheme. But for the life of me, I cannot figure out where to set the default in the STEMAPP/config.json so that it automatically sets to my theme.

No matter where I try to set the default, it always goes back to FoldableTheme. If I put and entry for FoldableTheme in the STEMAPP/THEMES/.repoignore and also remove it from the STEMPAPP/THEMES/list.json, the AWAB Dev just stops working.

I'm also having no joy with deafult Title and Subtitle entries, I've prepopulated these so that any new app created from STEMAPP would have these entries by default, but no joy - it still defaults to "built using ArcGIS Web AppBuilder"

This is my config.json in STEMAPP

{
  "theme": {
    "name": "BCGovTheme",
  "styles": ["default"],
  "version": "2.0beta"
  },
  "portalUrl": "",
  "appId": "",
  "authorizedCrossOriginDomains": [],
  "title": "Application Name",
  "subtitle": "Province of British Columbia",
  "httpProxy": {
    "useProxy": true,
    "url": "/proxy.js"
  },


  "geometryService": "http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer",


  "links": [{
    "label": "ArcGIS Online",
    "url": "//www.arcgis.com"
  }],


  "widgetOnScreen": {
    "widgets": [{
      "uri": "themes/BCGovTheme/widgets/HeaderController/Widget",
      "position": {
        "left": 0,
        "top": 0,
        "right": 0,
        "height": 40,
        "relativeTo": "browser"
      }
    }, {
      "uri": "widgets/Scalebar/Widget",
      "position": {
        "left": 25,
        "bottom": 25
      }
    }, {
      "uri": "widgets/Search/Widget",
      "position": {
        "left": 45,
        "top": 5
      }
    }, {
      "label": "Coordinate",
      "uri": "widgets/Coordinate/Widget",
      "position": {
        "left": 200,
        "bottom": 20
      }
    }, {
      "label": "Select a basemap",
      "uri": "widgets/BasemapGallery/Widget",
      "position": {
        "left": 45,
        "top": 45,
        "width": 360,
        "height": 410
      }
    }, {
      "label": "Measure",
      "uri": "widgets/Measurement/Widget",
      "position": {
        "left": 95,
        "top": 45,
        "height": 200
      }
    }, {
      "label": "Query",
      "uri": "widgets/Query/Widget",
      "position": {
        "left": 145,
        "top": 45,
        "width": 380,
        "height": 410
      }
    }, {
      "label": "Overview",
      "uri": "widgets/OverviewMap/Widget",
      "position": {
        "top": 0,
        "right": 0
      }
    }, {
      "uri": "widgets/ZoomSlider/Widget",
      "position": {
        "top": 5,
        "left": 7
      }
    }, {
      "uri": "widgets/HomeButton/Widget",
      "position": {
        "left": 7,
        "top": 75
      }
    }, {
      "uri": "widgets/MyLocation/Widget",
      "position": {
        "left": 7,
        "top": 110
      }
    },{
        "uri": "widgets/Splash/Widget",
        "position": {
          "relativeTo": "browser"
        },
        "version": "2.0beta",
        "id": "widgets_Splash_Widget_31",
        "name": "Splash",
        "label": "Splash",
        "config": "configs/Splash/config_Splash.json"
      },
  {
      "uri": "widgets/AttributeTable/Widget",
      "position": {
        "relativeTo": "browser"
    }
    }]
  },


  "map": {
    "3D": false,
    "2D": true,


    "position": {
      "left": 0,
      "top": 40,
      "right": 0,
      "bottom": 0
    },


    "itemId": "",


    "mapOptions": {
      "center": [-98, 40],
      "scale": 16937199
    }
  },


  "widgetPool": {
    "panel": {
      "uri": "themes/BCGovTheme/panels/FoldablePanel/Panel",
      "position": {
        "top": 5,
        "right": 5,
        "bottom": 5
      }
    },


    "widgets": [{
      "label": "Bookmark",
      "uri": "widgets/Bookmark/Widget"
    }, {
      "label": "Legend",
      "uri": "widgets/Legend/Widget"
    }, {
      "label": "LayerList",
      "uri": "widgets/LayerList/Widget"
    }, {
      "label": "Edit",
      "uri": "widgets/Edit/Widget"
    }, {
      "label": "Draw",
      "uri": "widgets/Draw/Widget"
    }, {
      "label": "Print",
      "uri": "widgets/Print/Widget"
    }, {
      "label": "Chart",
      "uri": "widgets/Chart/Widget"
    }, {
      "label": "Directions",
      "uri": "widgets/Directions/Widget"
    }, {
      "uri": "widgets/Geoprocessing/Widget"
    }]
  },


  "loadingPage": {
    "backgroundColor": "#003366",
    "backgroundImage":{
      "visible":false
    },
    "loadingGif":{
      "visible": true,
      "uri": "configs/loading/images/predefined_loading_1.gif",
      "width": 58,
      "height": 29
    }
  },


  "wabVersion": "2.0beta"
}
0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Esteemed Contributor

Nathan,

   This is how I was able to do it.

In the [install dir]\client\stemapp\predefined-apps\default\config.json you need to replace the theme and any widget controllers your theme uses. I renames the default config.json to config__.json and then opened it in my IDE. I then took the config.json from an app that used the theme I wanted to set as my default and copied it to the above mentioned path. Then I cleared out things like the map ItemId and other things that were setup in the copied apps config.json that I wanted to reset to default values (I did this by looking at the config__.json file as the example of a clean json). It worked well for me and I have the JewleryBox them as my default.