EPrints Technical Mailing List Archive

Message: #04611


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Re: Advanced Search Page render of large number of choices (such as language).


All,

I've made the suggested changes.  However, I see in my advanced search languages field is defined as '{ meta_fields => [ "documents.language" ] },'  which is not defined in either of the eprint_fields.pl or document_fields.pl in the archive config directory.  But I did change our 'degree' field in the eprint_fields.pl to use 'search_input_style' => 'select' (Thanks for the tip Gilles.) and it is now showing as a select list box.  So I now see that using the 'search_input_style' change does indeed work.  Is there some indication anywhere of what the available options are for this as this is the first time I've run across this?

I've found what looks to be the original documents.language field definition in the perl_lib/EPrints/DataObj/Document.pm file as ' ' name=>"language", type=>"namedset", required=>1, input_rows=>1, set_name=>"languages"' Can I just re-enter it in the archive document_fields.pl file to override it or will that cause an issue with the archive (two definitions of the same field)?  I'm not sure if field definitions can be used as an override or they just additive in nature.

Thanks,
Brian.

-----Original Message-----
From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Field A.N.
Sent: Tuesday, September 01, 2015 8:32 AM
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: Advanced Search Page render of large number of choices (such as language).

Hmmm....  I've explored the codebase, and it looks like there's a 'search_input_style' property.  It looks like for a 'set' type, it defaults to 'checkbox'.  This is tested for here:

	https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/MetaField/Set.pm#L413

...I don't think it's tested for anywhere else.  In your field definition, add:

	'search_input_style' => 'default',

...and see what happens.  You'll have to reload the configuration or restart the webserver.

--
Adam Field
Business Relationship Manager and Community Lead EPrints Services
+44 (0)23 8059 8814





On 31 Aug 2015, at 17:48, Brian D. Gregg wrote:

> All,
>  
> I've been asked to find out if there is a "better way" to render a field that has a large number of choices such as the language field that may have upwards of 140 languages all listed on the advanced search page as each individually with a check box.   What I understand we are looking for is if there is a way to have this as a single select drop-down box or a multi-select drop-down box so that the languages field doesn't take up so much real estate on the page.
>  
> Any hints suggestions would be welcome.
>  
> Thanks.
>  
> Brian D. Gregg
> Solutions Architect | Manager Systems Development University of 
> Pittsburgh | University Library System
> Address: 7500 Thomas Blvd.  Room 129 Pittsburgh, PA 15208
> Tel: (412) 648-3264 | Email: bdgregg@pitt.edu | Fax: (412) 648-3585
>  
> *** Options: 
> http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/