[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Re: DataObj->render_citation options



I would suggest using an automatic field when you want to render it differently in a different context.  That's what I've done in the past.  Create a creators_nolink field, and have it render the value in creators without the links.  There's even a training video about it 8->

--
Adam Field
Business Relationship Manager and Community Lead
EPrints Services

I am currently not working in the UK.  Due to timezone differences (GMT -9) email responses may take longer.

On 13 Jul 2015, at 17:31, Alan.Stiles <alan.stiles at open.ac.uk> wrote:

> Thanks. It?s a hole of my own digging where I?ve amended the creators render to format internal author names as links to their author browse view unless nolink is set.  Elsewhere I?m then trying to use the citation but without the links rendering.  I?ve worked around it for now with some cludgy regex but it seems like there should be a more elegant solution.  I?ll have a look at these links and see what comes out.  Thanks for taking time out of your holiday.
>  
> Alan
>  
> From: Adam Field [mailto:af05v at ecs.soton.ac.uk] 
> Sent: 13 July 2015 03:59
> To: eprints-tech at ecs.soton.ac.uk
> Subject: [EP-tech] Re: DataObj->render_citation options
>  
> The actual call appears to be here:
>  
>                 https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Script.pm#L149
>  
> ...which appears to hard-codes nolink to 0.  You can define opts in print tags in citations, so it's not beyond the realms of reason that this can't be passed through the twisty rabbit warren.  The opts are just sucked up into the arguments here:
>  
>                 https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/XML/EPC.pm#L250
>  
> What is the actual problem you're trying to solve?
>  
> --
> Adam Field
> Business Relationship Manager and Community Lead
> EPrints Services
>  
> I am currently not working in the UK.  Due to timezone differences (GMT -9) email responses may take longer.
>  
> On 10 Jul 2015, at 19:15, Alan.Stiles <alan.stiles at open.ac.uk> wrote:
> 
> 
> Thanks Adam, kind of useful ? I was trying to figure out if it was possible to pass a ?nolink? flag from a call to DataObj->render_citation($style, %opts)  that will get picked up by Metafield->render_value($session, $value, $alllangs, $nolink, $object) but I keep getting lost in the twisty rabbit warren between the functions!
>  
> From: Adam Field [mailto:af05v at ecs.soton.ac.uk] 
> Sent: 10 July 2015 09:21
> To: eprints-tech at ecs.soton.ac.uk
> Subject: [EP-tech] Re: DataObj->render_citation options
>  
> The actual rendering happens here:
>  
>                 https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Citation/EPC.pm#L64
>  
> But is is a confusing, twisty route.  A call to render_citation should look like this:
>  
> $eprint->render_citation('citation_name', %params);
>  
> ...where params is a hash that looks like this:
>  
> (
>                 thing1 => DOM_OBJECT,
>                 thing2 => DOM_OBJECT,
>                 flags => {
>                                 flag1 => 1,
>                                 flag2 => 0,
>                                 flag3 => 1,
>                 },
> )
>  
> Params are things that are passed through that may be used in the citation.  Generally speaking, these are dom objects to be put into the citation or flags to base conditionals upon.
>  
> Does that help?
>  
> --
> Adam Field
> Business Relationship Manager and Community Lead
> EPrints Services
>  
> I am currently not working in the UK.  Due to timezone differences (GMT -9) email responses may take longer.
>  
> On 9 Jul 2015, at 20:21, Alan.Stiles <alan.stiles at open.ac.uk> wrote:
> 
> 
> 
> Can anyone point me to a wiki page or a .pm file that defines what the possible values for %opts are for DataObj->render_citation() ?
>  
> I?m having a complete failure to figure out what they are or what the chain of functions is that finally leads to the Metafield->render_value function
> Thanks!
> Alan
> -- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302). The Open University is authorised and regulated by the Financial Conduct Authority.
> *** 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/
>  
> *** 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/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20150713/ad8ce7be/attachment-0001.html