Eric,If I understand your question correctly then sure you can use the templates with a web map created via json. Here's an example that takes a web map, from the 'Create Web Map from JSON' developer sample and uses that with the Basic Viewer template. I just create the web map then set the web map as the configOptions.webmap value.
<script type="text/javascript">
dojo.require("dijit.dijit");
dojo.require("dijit.dijit-all");
dojo.requireLocalization("esriTemplate","template");
</script>
<script type="text/javascript" src="javascript/layout.js">
</script>
<script type="text/javascript">
var configOptions;
function init() {
var webmap = {};
webmap.item = {
"title":"Soil Survey Map of USA",
"snippet": "This map shows the Soil Survey Geographic (SSURGO) by the United States Department of Agriculture's Natural Resources Conservation Service.",
"extent": [[-139.4916, 10.7191],[-52.392, 59.5199]]
};
webmap.itemData = {
"operationalLayers": [{
"url": "http://server.arcgisonline.com/ArcGIS/rest/services/Specialty/Soil_Survey_Map/MapServer",
"visibility": true,
"opacity": 0.75,
"title": "Soil Survey Map",
"itemId": "204d94c9b1374de9a21574c9efa31164"
}],
"baseMap": {
"baseMapLayers": [{
"opacity": 1,
"visibility": true,
"url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer"
},{
"isReference": true,
"opacity": 1,
"visibility": true,
"url": "http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer"
}],
"title": "World_Terrain_Base"
},
"version": "1.1"
};
configOptions = {
//The ID for the map from ArcGIS.com
//webmap:"dbd1c6d52f4e447f8c01d14a691a70fe",
webmap:webmap,
//The id for the web mapping applciation item that contains configuration info - in most
//cases this will be null.
appid:"",
//set to true to display the title
displaytitle:true,
//Enter a title, if no title is specified, the webmap's title is used.
title:"",
//Enter a description for the application. This description will appear in the left pane
//if no description is entered the webmap description will be used.
description: "",
//Specify a color theme for the app. Valid options are gray,blue,purple,green and orange
theme:'gray',
//Optional tools - set to false to hide the tool
//set to false to hide the zoom slider on the map
displayslider:true,
displaymeasure:true,
displaybasemaps:true,
displayoverviewmap:true,
displayeditor:true,////When editing you need to specify a proxyurl (see below) if the service is on a different domain
//Specify a proxy url if you will be editing
proxyurl: "http://autumn/proxy/proxy.ashx",
displaylegend:true,
displaysearch:true,
displaylayerlist:true,
displaybookmarks:true,
....... more config stuff here
};
initMap();
}
dojo.addOnLoad(init);
</script>