<?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 Don&amp;apos;t show the popup menu when only one type of document in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/don-apos-t-show-the-popup-menu-when-only-one-type-of-document/m-p/324100#M11101</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Sometime i only have the possibility to add one type of document, It's possible to bypass the popup menu and directly move to the document creation layout ?&lt;/P&gt;
&lt;P&gt;If i can't, i think i have to do a User Action who do the job.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 30 Aug 2013 14:40:10 GMT</pubDate>
    <dc:creator>Smart_amp_Soft_</dc:creator>
    <dc:date>2013-08-30T14:40:10Z</dc:date>
    <item>
      <title>Don&amp;apos;t show the popup menu when only one type of document</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/don-apos-t-show-the-popup-menu-when-only-one-type-of-document/m-p/324100#M11101</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Sometime i only have the possibility to add one type of document, It's possible to bypass the popup menu and directly move to the document creation layout ?&lt;/P&gt;
&lt;P&gt;If i can't, i think i have to do a User Action who do the job.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2013 14:40:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/don-apos-t-show-the-popup-menu-when-only-one-type-of-document/m-p/324100#M11101</guid>
      <dc:creator>Smart_amp_Soft_</dc:creator>
      <dc:date>2013-08-30T14:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Don&amp;apos;t show the popup menu when only one type of document</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/don-apos-t-show-the-popup-menu-when-only-one-type-of-document/m-p/324101#M11102</link>
      <description>&lt;P&gt;In short: you could probably do it, but it would be complicated for what it's worth.&lt;/P&gt;
&lt;P&gt;Here's a possible approach (not tested):&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Override the default "newDocument" action (&lt;A href="http://explorer.nuxeo.org/nuxeo/site/distribution/Nuxeo%20Platform-5.6/viewContribution/org.nuxeo.ecm.platform.actions--actions"&gt;source&lt;/A&gt;) to make it hide when there's only &amp;lt;= 1 available type&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;  ...
  &amp;lt;rule grant="false"&amp;gt;
     &amp;lt;condition&amp;gt;#{typesTool.getTypesList().size() &amp;lt;= 1}&amp;lt;/condition&amp;gt;
  &amp;lt;/rule&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Add a new user action (like you said), that will appear only in this case. A limitation is that you will have to explicitly specify the document type to be created, like with the "newWorskace" button (see the "link" attribute):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; &amp;lt;action ... link="#{documentActions.createDocument('Workspace')}"&amp;gt;
 ...
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;You could hack this issue by making one button for each type and add some complex conditions, but it would get quite complicated.&lt;/P&gt;
&lt;P&gt;Alternately, if you're not afraid of XHTML, you could write some code to tweak the &lt;CODE&gt;"select_document_type.xhtml"&lt;/CODE&gt; template, which is more technical but probably a better idea.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2013 10:41:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/don-apos-t-show-the-popup-menu-when-only-one-type-of-document/m-p/324101#M11102</guid>
      <dc:creator>Marwane_K_A_</dc:creator>
      <dc:date>2013-09-04T10:41:57Z</dc:date>
    </item>
  </channel>
</rss>

