Public Maps Gallery open items in the same window

2992
8
Jump to solution
12-02-2014 08:50 AM
RyanSellman
Occasional Contributor II

I have downloaded the Public Maps and Apps Gallery template and have done some customizing to give it the same look and feel as the rest of our website.  The one thing that I cannot figure out is how to change the way gallery items are opened.  Currently if you click on a resource in the gallery, it opens up a new tab/window (so its creating a link using target: _blank).  I would like for the resource to be opened within the same browser window (target: _self).  In the config file, options.js there is a property called "openGalleryItemsNewWindow" which suggests it would control the behavior with a boolean value.  However, setting it to false doesn't make any changes to the application.  Does anyone know how I can make this change?

Thanks for any help in advance!

Ryan

0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

Ryan,

I just tested and for a group with apps it looks like the openGalleryItemsNewWindow doesn't apply. You can change this by editing the home.js file. There are two lines that set the linkTarget to target=_blank one at approximately line 409 and one at 523. Modify both of those to target=_self and that should resolve the issue. Let me know if this doesn't work for you.

View solution in original post

0 Kudos
8 Replies
KellyHutchins
Esri Frequent Contributor

Ryan,

I downloaded the source code from the github repo and set it up to run locally on my machine. By default when I clicked on an item in the gallery it opened in the same window. Checked options.js and openGalleryItemsNewWindow was set to false. I set it to true and items then started opening in a new window.

Is this the same template app you are using? If so can you try double-checking to make sure the openGalleryItemsNewWindow is set to false then clear your cache and see if that resolves the issue?

If it does not can you provide more details, for example which browser? Also if you have a public link to the problem app can you share it?

RyanSellman
Occasional Contributor II

Thanks for the response, Kelly.  Yes that is the same template application I am using.  Like you, I just downloaded the code from the github repo and installed locally.  The items in the default sample group do open in the same window for me, but when I change the group ID to the AGO group I am using in my application, I get the same problem.  I am wondering if its because my group is full of custom applications hosted on my web server, rather than web maps.  Haven't tested in anything but Chrome but will try other browsers now.

This is my application:

http://summitmaps.summitoh.net/WebAppGallery/

Here is my options.js.:

define([], function() {
    var config = {
        "group": "1a13ba1acc6843578577c32ac823bcc0",
        "appid": "",
        "theme": "blueTheme",
        "siteTitle": " ",
        "siteBannerImage": "images/seal_Black_Blue.png",
        "mapTitle": "",
        "mapSnippet": "",
        "mapItemDescription": "",
        "mapLicenseInfo": "",
        "homeHeading": "",
        "homeSnippet": "",
        "homeSideHeading": "",
        "homeSideContent": "",
        "footerHeading": "",
        "footerDescription": "",
        "footerLogo": "images/MapsandAppsLogo_PMG.png",
        "footerLogoUrl": "https://summitgis.maps.arcgis.com/home/index.html",
        "addThisProfileId": "xa-4f3bf72958320e9e",
        "defaultLayout": "list",
        "searchString": "",
        "sortField": "modified",
        "sortOrder": "desc",
        "searchType": "",
        "mapViewer": "simple",
        "paginationSize": 2,
        "galleryItemsPerPage": 9,
        "showProfileUrl": false,
        "showSocialButtons": false,
        "showFooter": true,
        "showBasemapGallery": true,
        "showArcGISBasemaps": true,
        "basemapsGroup": {},
        "showGroupSearch": true,
        "showGroupSort": false,
        "showMapSearch": true,
        "showLayerToggle": true,
        "showLayoutSwitch": true,
        "showOverviewMap": true,
        "showMoreInfo": false,
        "showPagination": true,
        "showExplorerButton": false,
        "showArcGISOnlineButton": false,
        "showLicenseInfo": true,
        "showAttribution": true,
        "showComments": false,
        "showRatings": false,
        "showViews": true,
        "showMobileButtons": true,
        "openGalleryItemsNewWindow": false,
        "bannerBackground": "images/ui/pmg_banner_map_app.png",
        "proxyUrl": "",
        "sharingurl": "",
        "iosAppUrl": "itms://itunes.apple.com/us/app/arcgis/id379687930?mt=8",
        "androidAppUrl": "https://market.android.com/details?id=com.esri.android.client",
        "pointGraphic": "images/ui/bluepoint-21x25.png",
        "sourceCountry": "USA"
    };
    return config;
});
0 Kudos
KellyHutchins
Esri Frequent Contributor

Ryan,

I just tested and for a group with apps it looks like the openGalleryItemsNewWindow doesn't apply. You can change this by editing the home.js file. There are two lines that set the linkTarget to target=_blank one at approximately line 409 and one at 523. Modify both of those to target=_self and that should resolve the issue. Let me know if this doesn't work for you.

0 Kudos
RyanSellman
Occasional Contributor II

Awesome!  That was it.  Thank you so much for the help!

0 Kudos
RyanSellman
Occasional Contributor II

Similarly, items in the main banner gallery on my ArcGIS Online homepage open in a separate tab, aside from webmaps.  I assume I have no control over this behavior, right?

0 Kudos
KellyHutchins
Esri Frequent Contributor

Ryan,

I don't think you have control over that behavior.

0 Kudos
RyanSellman
Occasional Contributor II

I didn't think so - just wanted to be sure.  Thanks again for the help!

0 Kudos
CarmelConnolly3
Occasional Contributor II

Thanks khutchins-esristaff for your guidance! Just incase anyone needs to find this in the newest version of the app, _blank and be changed to _self in the gallery.json file in \\<directoryname>\widgets\gallery

Carmel

0 Kudos