EPrints Technical Mailing List Archive

Message: #02873


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

[EP-tech] Re: Dynamic Content and pins


From what I remember (been away doing reading lists stuff for 24 hours = brain warped), this might help:

http://files.eprints.org/555/

 

Cheers,

John

 

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Matthew Brady
Sent: 11 April 2014 10:09
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: Dynamic Content and pins

 

Hi,

 

Sorry, I forgot to mention, I have placed the pin into the xpage file, trying all sorts of variations, for how I thought it might work.  cu

In the dynamic_template.pl file I have amongst other code… (which I have hacked a bit to make it look more like the way 3.3.10 seems to want to do things??)

 

$c->add_trigger( EP_TRIGGER_DYNAMIC_TEMPLATE, sub {

 

      my %params = @_;

 

      my $repo = $params{repository};

      my $pins = $params{pins};

 

      my $phrasepin = $repo->xml->create_document_fragment;

      $phrasepin->appendChild( $repo->xml->create_text_node('abc123'));

     

      $pins->{todays_date} = $phrasepin;

      $pins->{d_o_t_day} = $phrasepin;

     

      print STDERR "DONE IN dynamic_template.pl\n";

      return EP_TRIGGER_OK;

} );

 

Directly placing the first pin into the xml file

 

<h1 class="ep_tm_pagetitle">

  <epc:pin ref="title"/>

</h1>

<epc:pin ref="todays_date"/>

<epc:pin ref="page"/>

 

Returns abc123 between the Title of the page, and the xpage contents…

 

I created a phrase to allow me to wrap the pin contents with text in a standard way, which currently contains some prefix text, and the pin,

<phrase id="d_o_t_d">Deposit of the Day =[<pin name="d_o_t_day"></pin>]</phrase> 

 

Within the xpage file I have placed 

<epc:phrase ref="d_o_t_d" />

Which displays on screen

Deposit of the Day =[[pin missing: d_o_t_day]]

 

 

Cheers

 

Matt.

 

 

 

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Alan.Stiles
Sent: Friday, 11 April 2014 6:19 PM
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: Dynamic Content and pins

 

Hi Matt,

The main index page is defined in  

.…/eprints3/archives/<ARCHIVEID>/cfg/lang/en/static/index.xpage

 

Try adding your pin there.  Not sure whether the pin logic needs to be in dynamic_template.pl or somewhere else for this page though – give it a try and see what happens.

 

Alan

 

From: Matthew Brady [mailto:Matthew.Brady@usq.edu.au]
Sent: 11 April 2014 06:26
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Dynamic Content and pins

 

Hi All,

 

I am trying to add some dynamic content onto the index page,

 

According to the doco, last updated 2012, (http://wiki.eprints.org/w/Branding_with_confidence#Pins) to add dynamic content into a template

 

Create the pin/logic in the dynamic_template.pl file

 

Then edit your xml file e.g. “archives/ARCHIVEID/cfg/lang/en/templates/default.xml”

 

So far, so good, This all works and I can drop dynamic content into the resulting page…via the xml… and it will render between the title and the xpage’s content…

 

<!-- MAIN CONTENT BOX -->

<div id="ep_tm_page_content_container">

  <div class="ep_tm_page_content">

    <h1 class="ep_tm_pagetitle">

      <epc:pin ref="title"/>

    </h1>

    <epc:pin ref="matts_dynamic_content"/>

    <epc:pin ref="page"/>

  </div>

</div>

<!-- END MAIN CONTENT BOX -->

 

BUT….

 

How do I get it to drop the dynamic content within the layout of the xpage…  I thought it would be simple, maybe, it’s just a Friday thing….

 

Any help would be appreciated.

 

Matt

 
_____________________________________________________________
This email (including any attached files) is confidential and is for the intended recipient(s) only. If you received this email by mistake, please, as a courtesy, tell the sender, then delete this email.
 
The views and opinions are the originator's and do not necessarily reflect those of the University of Southern Queensland. Although all reasonable precautions were taken to ensure that this email contained no viruses at the time it was sent we accept no liability for any losses arising from its receipt.
 
The University of Southern Queensland is a registered provider of education with the Australian Government.
(CRICOS Institution Code QLD 00244B / NSW 02225M, TEQSA PRV12081 )

-- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302).

 
_____________________________________________________________
This email (including any attached files) is confidential and is for the intended recipient(s) only. If you received this email by mistake, please, as a courtesy, tell the sender, then delete this email.
 
The views and opinions are the originator's and do not necessarily reflect those of the University of Southern Queensland. Although all reasonable precautions were taken to ensure that this email contained no viruses at the time it was sent we accept no liability for any losses arising from its receipt.
 
The University of Southern Queensland is a registered provider of education with the Australian Government.
(CRICOS Institution Code QLD 00244B / NSW 02225M, TEQSA PRV12081 )