WE HAVE SUNSET THIS LISTSERV - Join us at collectionspace@lyrasislists.org
View all threadsI have a field that I would like to add to the Advanced Search page and one that I'd like to remove. Adding the field seems straight forward -- the Config Fields reference doc says to add a ui-search attribute to the element:
That doesn't seem to be working though -- is this right?
I have rebuilt the code and am running with the Chrome Developer Tools option to "Disable Cache (while DevTools is open)", so I think there is something in the configuration that I'm missing.
Secondly, there is a field from the advanced search page that is not being used, but it is the base schema. The documentation has a How-To on suppressing fields in the UI without removing them from the base schema (https://wiki.collectionspace.org/display/DOC/How+to+hide+a+field+or+group+of+fields), but of course the schema is being read and processed at the application layer. I haven't dug deep into how XMLmerge works, so I'm hoping someone can offer some advice on the required incantation in the merge file to remove the ui-search element from the field tag.
Peter Murray
Dev/Ops Lead and Project Manager
Cherry Hill Company
Right after sending the last message, I had a thought about a way to remove a field from the advanced search:
On Nov 12, 2015, at 11:07 AM, Peter Murray pmurray@chillco.com wrote:
Secondly, there is a field from the advanced search page that is not being used, but it is the base schema. The documentation has a How-To on suppressing fields in the UI without removing them from the base schema (https://wiki.collectionspace.org/display/DOC/How+to+hide+a+field+or+group+of+fields), but of course the schema is being read and processed at the application layer. I haven't dug deep into how XMLmerge works, so I'm hoping someone can offer some advice on the required incantation in the merge file to remove the ui-search element from the field tag.
I wondered what would happen if I used XMLmerge to set the 'ui-search' and 'mini' fields to empty:
Interestingly, what happened was that the field sort of still exists in the UI: the label disappears and the pulldown <select> list has only "Options not loaded". This is leading me to believe that the Advanced Search fields are actually defined somewhere else in addition to being in the record schema....
Peter Murray
Dev/Ops Lead and Project Manager
Cherry Hill Company
Hi Peter,
To remove a field from advanced search you have to edit the HTML template
in the UI, e.g. html/components/SearchFieldsTemplate-cataloging.html.
You've hit on the right way to remove attributes in the app layer. There's
no way to remove them completely via XML merge, but you can override them
to be empty, and hope the app layer treats the empty string the same as a
non-existent attribute. In most cases, it does.
To remove a field from search you don't have to remove the
search="repeatable" attribute in the app layer config, it's sufficient to
remove the markup from the UI. If you do remove the search attribute, the
only difference is that field will be removed from the uispec payload that
is sent from the app layer to the UI, so you save a few bytes there. I
don't think it's worth the effort.
Ray
On Thu, Nov 12, 2015 at 8:31 AM, Peter Murray pmurray@chillco.com wrote:
Right after sending the last message, I had a thought about a way to
remove a field from the advanced search:
On Nov 12, 2015, at 11:07 AM, Peter Murray pmurray@chillco.com wrote:
Secondly, there is a field from the advanced search page that is not
being used, but it is the base schema. The documentation has a How-To on
suppressing fields in the UI without removing them from the base schema (
https://wiki.collectionspace.org/display/DOC/How+to+hide+a+field+or+group+of+fields),
but of course the schema is being read and processed at the application
layer. I haven't dug deep into how XMLmerge works, so I'm hoping someone
can offer some advice on the required incantation in the merge file to
remove the ui-search element from the field tag.
I wondered what would happen if I used XMLmerge to set the 'ui-search' and
'mini' fields to empty:
Interestingly, what happened was that the field sort of still exists in
the UI: the label disappears and the pulldown <select> list has only
"Options not loaded". This is leading me to believe that the Advanced
Search fields are actually defined somewhere else in addition to being in
the record schema....
Peter Murray
Dev/Ops Lead and Project Manager
Cherry Hill Company
Talk mailing list
Talk@lists.collectionspace.org
http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org
Ah! There it is. Thanks, Ray. I've added a note to the "How to hide a field or group of fields" page in the Unreleased documentation:
https://wiki.collectionspace.org/display/UNRELEASED/How+to+hide+a+field+or+group+of+fields#Howtohideafieldorgroupoffields-Specialcasesandwordsofwarning https://wiki.collectionspace.org/display/UNRELEASED/How+to+hide+a+field+or+group+of+fields#Howtohideafieldorgroupoffields-Specialcasesandwordsofwarning
Peter
On Nov 12, 2015, at 4:18 PM, Ray Lee rhlee@berkeley.edu wrote:
Hi Peter,
To remove a field from advanced search you have to edit the HTML template in the UI, e.g. html/components/SearchFieldsTemplate-cataloging.html.
You've hit on the right way to remove attributes in the app layer. There's no way to remove them completely via XML merge, but you can override them to be empty, and hope the app layer treats the empty string the same as a non-existent attribute. In most cases, it does.
To remove a field from search you don't have to remove the search="repeatable" attribute in the app layer config, it's sufficient to remove the markup from the UI. If you do remove the search attribute, the only difference is that field will be removed from the uispec payload that is sent from the app layer to the UI, so you save a few bytes there. I don't think it's worth the effort.
Ray
On Thu, Nov 12, 2015 at 8:31 AM, Peter Murray <pmurray@chillco.com mailto:pmurray@chillco.com> wrote:
Right after sending the last message, I had a thought about a way to remove a field from the advanced search:
On Nov 12, 2015, at 11:07 AM, Peter Murray <pmurray@chillco.com mailto:pmurray@chillco.com> wrote:
Secondly, there is a field from the advanced search page that is not being used, but it is the base schema. The documentation has a How-To on suppressing fields in the UI without removing them from the base schema (https://wiki.collectionspace.org/display/DOC/How+to+hide+a+field+or+group+of+fields https://wiki.collectionspace.org/display/DOC/How+to+hide+a+field+or+group+of+fields), but of course the schema is being read and processed at the application layer. I haven't dug deep into how XMLmerge works, so I'm hoping someone can offer some advice on the required incantation in the merge file to remove the ui-search element from the field tag.
I wondered what would happen if I used XMLmerge to set the 'ui-search' and 'mini' fields to empty:
https://github.com/cherryhill/sdmom-tenant-config/blob/849213a94260c947ef427c1cb1615e52f6dc6d99/application/sdmom-collectionobject.xml#L8-L11 https://github.com/cherryhill/sdmom-tenant-config/blob/849213a94260c947ef427c1cb1615e52f6dc6d99/application/sdmom-collectionobject.xml#L8-L11
Interestingly, what happened was that the field sort of still exists in the UI: the label disappears and the pulldown <select> list has only "Options not loaded". This is leading me to believe that the Advanced Search fields are actually defined somewhere else in addition to being in the record schema....
Peter
--
Peter Murray
Dev/Ops Lead and Project Manager
Cherry Hill Company