EPrints Technical Mailing List Archive

Message: #05834


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

[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
    $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