[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[EP-tech] [3.3.15] How to define the path in a pin?
- Subject: [EP-tech] [3.3.15] How to define the path in a pin?
- From: J.Salter at leeds.ac.uk (John Salter)
- Date: Mon, 25 Jul 2016 08:38:51 +0000
- In-reply-to: <EMEW3|09a37d0a343562aa43c1d4de87417eccs6O9Fr14eprints-tech-bounces|ecs.soton.ac.uk|CA+BMZ6WSnp6FZOEUGQ_DiBUCi21pc0LdRNz=e334kaV5tOvYFg@mail.gmail.com>
- References: <CA+BMZ6WSnp6FZOEUGQ_DiBUCi21pc0LdRNz=e334kaV5tOvYFg@mail.gmail.com> <EMEW3|09a37d0a343562aa43c1d4de87417eccs6O9Fr14eprints-tech-bounces|ecs.soton.ac.uk|CA+BMZ6WSnp6FZOEUGQ_DiBUCi21pc0LdRNz=e334kaV5tOvYFg@mail.gmail.com>
Does this help:
https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Update/Views.pm#L717-L728
A phrase ?viewintro_view_1? might work?
It gets inserted at the top of the page ? which might not be what you want?
You can also include a ?template? argument for a view, if that helps?
Cheers,
John
From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Denis Pitzalis
Sent: 25 July 2016 09:15
To: Eprints Tech Mailing List <eprints-tech at ecs.soton.ac.uk>
Subject: [EP-tech] [3.3.15] How to define the path in a pin?
Hi Eprinters,
I am configuring a view and I want to display something only in a certain condition. The logic solution would be to use a pin I think. I can think of three methods:
1) a test in the template
<epc:if test="current_path eq '/views/1'" >
<div class="view_1" />
</epc:if>
2) a test in a dynamic_template
<epc:pin ref="view1" />
and then in the dynamic_template.pl<http://dynamic_template.pl>
$c->{dynamic_template}->{function} = sub {
my( $repository, $parts ) = @_;
if ( current_path() eq "/views/1" ) {
my $xml = $repository->xml();
my $div = $xml->create_element( "div", class => "view_1");
$parts->{view1} = $div;
}
};
3) a test in phrase? does this really works?
obviously I have been unable to make any of these works, do you have any experience?
Best,
Denis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20160725/f691fe68/attachment.html