Bug #67
search forms for named folders not working
| Status: | Resolved | Start: | 03/24/2010 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 100% |
|
| Category: | - | |||
| Target version: | - | |||
Description
Hi,
Firstly, love this software. Well done.
I am trying to get it to display a separate set of search fields based on which folder in the documentLibrary the user is in. This is the use case specified in the documentation. I have created a folder called "project images" in the root of the document library. I then have the following config but it always shows the basic search form.
<!-- Default form configuration for the cm:folder type -->
<config evaluator="node-type" condition="cm:folder" replace="true">
<forms>
<form>
<field-visibility>
<show id="cm:name" />
<show id="cm:title" force="true" />
<show id="cm:description" force="true" />
</field-visibility>
</form>
<form id="basic-search-form">
<field-visibility>
<show id="cm:name" />
<show id="cm:title" />
<show id="cm:description" />
<show id="cm:author" force="true" />
<show id="cm:creator" for-mode="edit" />
<show id="cm:created" force="true" />
<show id="cm:modifier" for-mode="edit" />
<show id="cm:modified" for-mode="edit" />
</config>
<show id="lud:cell_line" force="true"/>
<!-- tags and categories -->
<show id="cm:taggable" force="true"/>
<show id="cm:categories" force="true"/>
</form>
</field-visibility>
<appearance>
<field id="cm:name">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:title">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:description">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:author">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:taggable">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:categories">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:creator">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:created">
<control template="/org/alfresco/components/search/form/controls/date.ftl">
<control-param name="showTime">false</control-param>
</control>
</field>
<field id="cm:modifier">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:modified">
<control template="/org/alfresco/components/search/form/controls/date.ftl">
<control-param name="showTime">false</control-param>
</control>
</field>
<field id="lud:cell_line">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
</appearance>
<!-- Specific search to be applied when in images folder -->
<form id="project-images">
<field-visibility>
<show id="cm:name" />
<show id="lud:cell_line" force="true"/>
</field-visibility>
<appearance>
<field id="cm:name">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="lud:cell_line">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
</appearance>
</form>
</forms>
Regards
Brian
History
Updated by Brian O'Neill 682 days ago
Try again
@ <config evaluator="node-type" condition="cm:folder" replace="true">
<forms>
<form>
<field-visibility>
<show id="cm:name" />
<show id="cm:title" force="true" />
<show id="cm:description" force="true" />
</field-visibility>
</form>
@
<form id="basic-search-form">
<field-visibility>
<show id="cm:name" />
<show id="cm:title" />
<show id="cm:description" />
<show id="cm:author" force="true" />
<show id="cm:creator" for-mode="edit" />
<show id="cm:created" force="true" />
<show id="cm:modifier" for-mode="edit" />
<show id="cm:modified" for-mode="edit" />
</config>
<show id="lud:cell_line" force="true"/>
<!-- tags and categories -->
<show id="cm:taggable" force="true"/>
<show id="cm:categories" force="true"/>
</form>
</field-visibility>
<appearance>
<field id="cm:name">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:title">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:description">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:author">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:taggable">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:categories">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:creator">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:created">
<control template="/org/alfresco/components/search/form/controls/date.ftl">
<control-param name="showTime">false</control-param>
</control>
</field>
<field id="cm:modifier">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="cm:modified">
<control template="/org/alfresco/components/search/form/controls/date.ftl">
<control-param name="showTime">false</control-param>
</control>
</field>
<field id="lud:cell_line">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
</appearance>
<!-- Specific search to be applied when in images folder -->
<form id="project-images">
<field-visibility>
<show id="cm:name" />
<show id="lud:cell_line" force="true"/>
</field-visibility>
<appearance>
<field id="cm:name">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
<field id="lud:cell_line">
<control template="/org/alfresco/components/search/form/controls/textfield.ftl" />
</field>
</appearance>
</form>
</forms>
Updated by Mahmoud M'HIRI 682 days ago
Hi Brian,
Thank you for posting this, you can just put your code in a file and upload it while updating the issue.
Best Regards.
Updated by Imène BEN TAMANSOURT 682 days ago
Hi Brian,
First of all, thank you for downloading and testing this project and contributing to improve it.
It seems that we omitted to mention in the documentation that custom form id must end with “-search-form”
So your new search form must be declared as follow:
<form id="project-images-search-form">
Please try that and keep us informed with the result.
The documentation will be updated as soon as possible.
Best Regards.
Updated by Imène BEN TAMANSOURT 674 days ago
- Status changed from New to Resolved
- % Done changed from 0 to 100