<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Open gallery default by a specific type at the Local Government maps and apps Gal in State &amp; Local Government Questions</title>
    <link>https://community.esri.com/t5/state-local-government-questions/open-gallery-default-by-a-specific-type-at-the/m-p/617487#M4004</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mike,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for helping out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I was indeed looking for the setings in the updatgallery like you discribed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So now we can move on with the gallery.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wilfred&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jun 2014 05:50:02 GMT</pubDate>
    <dc:creator>WilfredKnol</dc:creator>
    <dc:date>2014-06-27T05:50:02Z</dc:date>
    <item>
      <title>Open gallery default by a specific type at the Local Government maps and apps Gallery</title>
      <link>https://community.esri.com/t5/state-local-government-questions/open-gallery-default-by-a-specific-type-at-the/m-p/617485#M4002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We are using the&amp;nbsp; Local Government maps and apps Gallery.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I was able to change the configuration so on startup the gallery is comming first and not the home page.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On the left side people can use filters. By default all the Categories and Types are show. But is it possible that on startup a specific type is shown and not all types?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know if and how this is possible. Would help me out a lot.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wilfred&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 10:35:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/open-gallery-default-by-a-specific-type-at-the/m-p/617485#M4002</guid>
      <dc:creator>WilfredKnol</dc:creator>
      <dc:date>2014-06-26T10:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Open gallery default by a specific type at the Local Government maps and apps Gal</title>
      <link>https://community.esri.com/t5/state-local-government-questions/open-gallery-default-by-a-specific-type-at-the/m-p/617486#M4003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Wilfred,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some background for others: when the app starts up, shortly after the &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;ready(function () {&lt;/SPAN&gt;&lt;SPAN&gt;, the code splits into two paths: "depends on config file" and "independent of config file".&amp;nbsp; The former is involved in reading the items from your group and setting up the gallery contents, which can take a little bit of time over the network; the latter are things that can be run right away.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A good place to switch to the gallery is at the end of the "independent" path; it would go right before the comment "// Show the site by hiding the loading background" that ends the path:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
changeSubpage("Gallery", false);

// Show the site by hiding the loading background
configIndependentInitReady = true;
hideLoading();
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For setting the initial filters, you'd do that after the items are fetched from the server, which is done with the following lines:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// Get the gallery data. We'll chain the three calls (for the Most Popular &amp;amp; Most Recent
// sections of the main page and for the Gallery page) so that we can use one fetch of
// data for all three. Otherwise, all three fetch calls are made before the data arrives
// and we end up making three fetches.
galleryData.fetch({
&amp;nbsp;&amp;nbsp;&amp;nbsp; sort: [{attribute: "numViews", descending: true}],
&amp;nbsp;&amp;nbsp;&amp;nbsp; start: 0, count: 7,
&amp;nbsp;&amp;nbsp;&amp;nbsp; onComplete: function(items, request){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Most Popular
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showPopular(items, request);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; galleryData.fetch({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sort: [{attribute: "modified", descending: true}],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; start: 0, count: 4,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onComplete: function(items, request){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Most Recent
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showRecent(items, request);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Gallery page
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateGallery(null, null, null);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
});
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note the &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;updateGallery(null, null, null);&lt;/SPAN&gt;&lt;SPAN&gt; call towards the end. It is here that you set your initial filter. The three parameters of &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;updateGallery()&lt;/SPAN&gt;&lt;SPAN&gt; are strings giving the desired category, the desired type, and the desired search term; a null is used to indicate all categories, all types, and no search term, respectively.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So if I want to start up the app with the gallery showing the "Elections &amp;amp; Voting" category and the "Web" type with no search term, I'd change &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;updateGallery(null, null, null);&lt;/SPAN&gt;&lt;SPAN&gt; to &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;updateGallery("Elections &amp;amp; Voting", "Web", null);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or for just the "Community Activities" category, I'd change &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;updateGallery(null, null, null);&lt;/SPAN&gt;&lt;SPAN&gt; to &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;updateGallery("Community Activities", null, null);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I want to use the search term, I'd do something a little bit different for efficiency. Because it would be helpful for the user to see the search term in the type-in box, I'd insert the starting search term into the type-in box. But because any change to that type-in box triggers a &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;updateGallery&lt;/SPAN&gt;&lt;SPAN&gt; call, first I'd set the desired starting category (variable &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;currentCategory&lt;/SPAN&gt;&lt;SPAN&gt;) and/or the desired starting type (variable &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;currentType&lt;/SPAN&gt;&lt;SPAN&gt;). So if I wanted to see all "Web" types that include a search term "park", I'd use&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
currentType = "Web";
dijit.byId("searchBox").set("value", "park");
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;and delete the redundant &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;updateGallery&lt;/SPAN&gt;&lt;SPAN&gt; call.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:23:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/open-gallery-default-by-a-specific-type-at-the/m-p/617486#M4003</guid>
      <dc:creator>MikeTschudi</dc:creator>
      <dc:date>2021-12-12T02:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Open gallery default by a specific type at the Local Government maps and apps Gal</title>
      <link>https://community.esri.com/t5/state-local-government-questions/open-gallery-default-by-a-specific-type-at-the/m-p/617487#M4004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mike,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for helping out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I was indeed looking for the setings in the updatgallery like you discribed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So now we can move on with the gallery.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wilfred&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 05:50:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/open-gallery-default-by-a-specific-type-at-the/m-p/617487#M4004</guid>
      <dc:creator>WilfredKnol</dc:creator>
      <dc:date>2014-06-27T05:50:02Z</dc:date>
    </item>
  </channel>
</rss>

