how to put title in PopupTemplate?

233
1
05-23-2022 11:02 AM
FredListy
New Contributor II

Hello, I have this code:

      const template = new PopupTemplate({
        title:"test title",
        content: [
          {
            type: "fields",

            fieldInfos: [
              {
                fieldName: "name",
                label: "Name",
              },
            ],
          },
        ],
      });
And so I add the template to some dot marks in a globe with :
 var pointGraphic = new Graphic({
          geometry: point,
          symbol: simpleMarkerSymbol,
          popupTemplate: template,
...}
And everything works except for the title, uless I put the title inside content, but then it will be under the header and I dont want this. Do you know how to add the title in the proper place (header) ?
0 Kudos
1 Reply
LaurenBoyd
Esri Contributor

Hi @FredListy -

The code you have looks like it should work. Do you have an example of this issue in a Codepen that you can share? You could also compare this sample with what you have: https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/

Lauren
0 Kudos