EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #01910
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: enabling new field "eprint_contributors"
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Re: enabling new field "eprint_contributors"
- From: Tim Brody <tdb2@ecs.soton.ac.uk>
- Date: Wed, 01 May 2013 11:38:29 +0100
On Mon, 2013-04-29 at 15:56 -0400, Nault, Pierre wrote:
> Hi,
>
>
>
> I’m posting this one again to see if we can get any
> answer.
>
>
>
> I’ve just enable the field “contributors”
> in /workflow/eprint/default.xml. The field is a combination of 3
> fields : contributors_type; contributors_name and contributors_id. In
> input area of the field contributors_type, I have an error message :
> “[pin missing : fieldname]”. Even with this error message, I still
> have access to the drop list of all types of contributors. Any idea
> where I can find or put the missing pin ?
As an admin, you should have an 'edit pages phrases' at the top of the
page. Clicking that should allow you to set the missing phrase.
> Also, I want the value of this field to be default to a certain value
> in the list of contributors type. I tried something in
> eprint_field_default.pl :
>
>
>
> $data->{contributor_type_typename} = "Thesis advisor";
>
>
>
> But It doesn’t work. How can I default the value of the field
> contributor_type_typename ?
Do you want to set this value in front of the user or is it ok to set
that only on write (i.e. if the user hasn't explicitly chosen a value,
then set it?)?
For the latter, you want to use eprint_fields_automatic.pl, with
something like (untested):
my @contributors = @{$eprint->value('contributors')};
foreach my $contributor (@contributors)
{
$contributor->{type} = 'advisor' if !
EPrints::Utils::is:set($contributor->{type});
}
$eprint->set_value('contributors', \@contributors);
To show a default in the workflow is more complex. I would use some
Javascript to modify the page when it's displayed ... because you need
to set the value only when the user has added a name, which means using
dynamic (not server-side) behaviour.
--
All the best,
Tim
Attachment:
signature.asc
Description: This is a digitally signed message part
- References:
- [EP-tech] enabling new field "eprint_contributors"
- From: "Nault, Pierre" <nault.pierre@uqam.ca>
- [EP-tech] enabling new field "eprint_contributors"
- From: "Nault, Pierre" <nault.pierre@uqam.ca>
- [EP-tech] enabling new field "eprint_contributors"
- Prev by Date: [EP-tech] Re: Mozilla Firefox/Waterfox Login Issue
- Next by Date: [EP-tech] default.xml
- Previous by thread: [EP-tech] enabling new field "eprint_contributors"
- Next by thread: [EP-tech] solved? Browse by Division
- Index(es):
