<?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 Limit nuxeo-document-create-button visibility to folderish documents? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/limit-nuxeo-document-create-button-visibility-to-folderish/m-p/324507#M11508</link>
    <description>&lt;P&gt;Is there an easy way to hide the nuxeo-document-create-button element so that it only shows when viewing a folderish document? We would like to disable the element in WebUI so that it doesn't show for other types of documents as it can sometimes obscure information, and that it really isn't needed for our users unless they are in a "folder" (or something with a similar view).&lt;/P&gt;
&lt;P&gt;This element seems to reside in &lt;A href="https://github.com/nuxeo/nuxeo-web-ui/blob/master/elements/nuxeo-app.js" target="test_blank"&gt;https://github.com/nuxeo/nuxeo-web-ui/blob/master/elements/nuxeo-app.js&lt;/A&gt;, and I'm not sure if I'm able to override that or not (probably isn't recommended to do so anyway). We are using LTS 2021 latest hotfix as well.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Overlay issue example"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/1925i566DB14759A0247E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Overlay issue example" alt="Overlay issue example" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Aug 2021 21:29:59 GMT</pubDate>
    <dc:creator>Phil_Ludlow</dc:creator>
    <dc:date>2021-08-27T21:29:59Z</dc:date>
    <item>
      <title>Limit nuxeo-document-create-button visibility to folderish documents?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/limit-nuxeo-document-create-button-visibility-to-folderish/m-p/324507#M11508</link>
      <description>&lt;P&gt;Is there an easy way to hide the nuxeo-document-create-button element so that it only shows when viewing a folderish document? We would like to disable the element in WebUI so that it doesn't show for other types of documents as it can sometimes obscure information, and that it really isn't needed for our users unless they are in a "folder" (or something with a similar view).&lt;/P&gt;
&lt;P&gt;This element seems to reside in &lt;A href="https://github.com/nuxeo/nuxeo-web-ui/blob/master/elements/nuxeo-app.js" target="test_blank"&gt;https://github.com/nuxeo/nuxeo-web-ui/blob/master/elements/nuxeo-app.js&lt;/A&gt;, and I'm not sure if I'm able to override that or not (probably isn't recommended to do so anyway). We are using LTS 2021 latest hotfix as well.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Overlay issue example"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/1925i566DB14759A0247E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Overlay issue example" alt="Overlay issue example" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 21:29:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/limit-nuxeo-document-create-button-visibility-to-folderish/m-p/324507#M11508</guid>
      <dc:creator>Phil_Ludlow</dc:creator>
      <dc:date>2021-08-27T21:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Limit nuxeo-document-create-button visibility to folderish documents?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/limit-nuxeo-document-create-button-visibility-to-folderish/m-p/324508#M11509</link>
      <description>&lt;P&gt;Note, I added some padding-bottom to the card in the screenshot to account for the document create button (so that it doesn't cover download options). That helps a bit, but we still are looking to disable/hide the button except on folderish document views.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 16:43:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/limit-nuxeo-document-create-button-visibility-to-folderish/m-p/324508#M11509</guid>
      <dc:creator>Phil_Ludlow</dc:creator>
      <dc:date>2021-09-03T16:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Limit nuxeo-document-create-button visibility to folderish documents?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/limit-nuxeo-document-create-button-visibility-to-folderish/m-p/324509#M11510</link>
      <description>&lt;P&gt;Posting a solution, in case anyone also would like to do this. Support came up with a script that I modified slightly and it seems to be working well so far (at least in development). Add the following code in your custom-bundle:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;script&amp;gt;
  const app = document.querySelector('nuxeo-app');
  app.$.pages.addEventListener('iron-select', () =&amp;gt; { 
    app.root.querySelector('nuxeo-document-create-button').hidden = (app.page === 'home') || (app.page === 'search') ? true : app.currentDocument &amp;amp;&amp;amp; (!app.currentDocument.facets.includes('Folderish') || app.currentDocument.facets.includes('Collection')); 
  });
&amp;lt;/script&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This will hide the document-create-button on the following pages in WebUI:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Home Page&lt;/LI&gt;
&lt;LI&gt;Search Page&lt;/LI&gt;
&lt;LI&gt;Any doctypes that do not have the Folderish facet&lt;/LI&gt;
&lt;LI&gt;Doctypes that have the Collection facet&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The goal we had was to hide the button on any page that could not directly have documents created in it. This code satisfies those conditions.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 16:34:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/limit-nuxeo-document-create-button-visibility-to-folderish/m-p/324509#M11510</guid>
      <dc:creator>Phil_Ludlow</dc:creator>
      <dc:date>2021-09-09T16:34:24Z</dc:date>
    </item>
  </channel>
</rss>

