EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #05837


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

Re: [EP-tech] [3.3.15] How to define the path in a pin?


As usual,

I love Eprints, everything is there, you just need a bit of trial and error, and read the source code. Thanks John for your suggestion that lead me to use:
<epp:phrase id="viewtitle_eprint_countries_list">
        <!-- leaflet -->
        <link rel="stylesheet" href="" href="https://npmcdn.com/leaflet@1.0.0-rc.2/dist/leaflet.css">https://npmcdn.com/leaflet@1.0.0-rc.2/dist/leaflet.css" />
        <script src="" href="https://npmcdn.com/leaflet@1.0.0-rc.2/dist/leaflet.js">https://npmcdn.com/leaflet@1.0.0-rc.2/dist/leaflet.js"></script>
        <link rel="stylesheet" href="" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.0.0-rc.1.0/MarkerCluster.css">https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.0.0-rc.1.0/MarkerCluster.css" />
        <script src="" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.0.0-rc.1.0/leaflet.markercluster.js">https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.0.0-rc.1.0/leaflet.markercluster.js"></script>
        <h1><epc:pin name="value1" /></h1>
        <div id="mapid" class="leaflet-container leaflet-fade-anim leaflet-grab leaflet-touch-drag" style="width: 100%; height: 400px; position: relative; outline: medium none; margin-bottom: 20px" tabindex="0" />
    </epp:phrase>

I hope this can help somebody, and I intend to write a long howto as soon as I've finished

Denis



On Mon, Jul 25, 2016 at 12:27 PM, Denis Pitzalis <denis.pitzalis@gmail.com> wrote:
Hi John,

thanks, but I'm afraid that the phrase viewintro_view will not work, unless I'll be able to display it only in the list page. I am using a leaflet map, so I need a
<div id="mymap" /> in my view_item_page

using a specific mymap template is nice because I can load the leaflet js only for that page, but I'm obliged to have the mymap call also in the menu page.

and for the phrase it is unclear for me if I can display the phrase only on the item list page.

Denis

On Mon, Jul 25, 2016 at 10:38 AM, John Salter <J.Salter@leeds.ac.uk> wrote:

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@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Denis Pitzalis
Sent: 25 July 2016 09:15
To: Eprints Tech Mailing List <eprints-tech@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
    $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


*** 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/




--