ArcGIS Online Basic Viewer Template and additional URL links.

808
2
02-03-2012 10:52 AM
MichaelKlein
New Contributor II
I'm trying to add an additional URL link to the ArcGIS Online Basic Viewer Template.  The Readme file included in the template download states to edit the index.html file with the URL link and link text.  I've done that.  The Readme file seems to indicate that I need to change something (mapOptions) in the layout.js also.  Can't figure that part out.  Does anyone have more detail about getting my additional URL link to work?

Thanks!
Tags (2)
0 Kudos
2 Replies
KellyHutchins
Esri Frequent Contributor
We could make this process a bit easier - but for now you'll have to make three changes to the app to get an extra link to appear.

1. Update the configuration section of index.html to have the text and url for the additional link:
          link1:{
            url:'www.esri.com',
            text:'Esri'
          },
          link2:{
            url:'www.cnn.com',
            text:'cnn'
          },
 link3:{
    url:'www.arcgis.com',
    text:'ArcGIS.com'
         },

2. Update the html portion to add the tags for the extra list item. You'll find this code around line 155 in index.html
    
     
           <ul>
            <li id="link1List">      
            </li>
            <li>|</li>
            <li id="link2List">
            </li>
     <li>|</li>
            <li id="link3List">
            </li>
          </ul>

3. Finally update the code in layout.js to associate the new text with the new item:
    dojo.create("a", {
      href: configOptions.link2.url,
      target: '_blank',
      innerHTML: configOptions.link2.text
    }, 'link2List');
  dojo.create("a", {
      href: configOptions.link3.url,
      target: '_blank',
      innerHTML: configOptions.link3.text
    }, 'link3List');

0 Kudos
MichaelKlein
New Contributor II
Thanks Kelly!  That worked for me.

Your templates make me look good.  I'm pretty template reliant.

http://newmdcgis.mdc.mo.gov/statewidefishattractorsver2/basicviewer%202/index.html
0 Kudos