AnsweredAssumed Answered

PrintTemplate: change map title dynamically?

Question asked by davidchrest on Oct 23, 2015
Latest reply on Sep 26, 2018 by clinton.ballandis

Is there a straightforward way for a user to change the map title text when printing a map instead of having it hard coded in the layoutOptions of the PrintTemplate?


I tried the following but did not work.






var MT = dom.byId("mapTitle").value

  // create a print template for each choice
  templates =, function (ch) {
  var plate = new PrintTemplate();
  plate.layout = plate.label = ch;
  plate.format = "PDF";
  plate.showAttribution = false;
  plate.exportOptions = {
  dpi: 150
  plate.layoutOptions = {

  "titleText": MT,
  "scalebarUnit": "Miles"
  return plate;

  // create the print dijit
  printer = new Print({
  "map": map,
  "templates": templates,
  url: printUrl
  }, dom.byId("print_button"));


Any help is very much appreciated.