EPrints Technical Mailing List Archive

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

Message: #03370


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

[EP-tech] Re: Latest Additions


Hi Seb,

A slightly simpler approach:

On your page:

<div id="fplatest"/>
<script type="text/_javascript_">
    new Ajax.Updater( 'fplatest', '/cgi/latest_tool', { parameters: { "mode":"fplatest", "mainonly":"yes" } } );
</script>

In your local configuration (archives/<id>/cfg/cfg.d/latest_modes.pl):

$c->{latest_tool_modes} = {
	default => { citation => "result" },
	fplatest => { citation => "result", max => 3 },
};

That will display the last 3 items, rendered using the "result.xml" citation.

(an other) Seb


On 07/08/14 17:42, Enio Carboni wrote:
Hi Sebastian,

 i think you can try to add a little Ajax code to the index.xpage where would you want to be displayed the "latest_tool chunk"
  • /image/roller.gif: you should download it in another place
  • the parameters: n=5 is the number of elements to display
<div>
  <div id="latest_tool_lookup_status" style="width:68%;">
   <p style="font-size:0.9em;">Loading latest documents in progress <img valign="middle" border="0" src="" alt="wait ..."/></p>
 </div>
 <div style="display:none; font-size:1.0em; font-weigth:normal;" id="latest_tool_lookup"></div>
</div>
<script type="text/_javascript_">
  <!--
  $("mail_title").style.display="none";
  ajax = new Ajax.Request('/cgi/latest_tool',
                          {method: 'get',
                           parameters: 'n=5',
                           contentType: "application/xml",
                           onSuccess: function(transport) {
                             $("latest_tool_lookup_status").style.display="none";
                             var parser = new DOMParser();
                             var xmlDoc = parser.parseFromString(transport.responseText, "application/xml");
                             tables=xmlDoc.getElementsByTagName("table");
                             for (i=0;i<tables.length;i++) {
                               if (tables[i].getAttribute('class')=='ep_tm_main') {
                                        $("latest_tool_lookup").appendChild(tables[i]);
                               }
                             }
                             $("latest_tool_lookup").style.display="block";
                           },
                           onFailure: function() {
                           }
                         }
                        );
 -->
</script>

  Enio

Il 07/08/2014 16:17, Sebastian Nozzi ha scritto:
Hello,

do you know how to change the start-page to have a list of "latest 
additions" like the one seen here?

http://epub.wu.ac.at/

So far I've found out that the file to edit is:

./cfg/lang/en/static/index.xpage

inside my archive, and that the information I need comes from the 
"./cgi/latest_tool" CGI-script.

But I'm not sure how to invoke that script to get an output as in the 
web-page I mentioned.

Any hints would be greatly appreciated.

Best regards,
Sebastian





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