[greenstone-devel] RE : hyperlink individual metadata elements
Katherine,
Thank you very much ! Every thing is working now...
But, if the subject field is empty, there is a bug on the page...
How to avoid this ?
Regards
Patrick Hernebring
Fonds musical ancien - Numérisation
Bibliothèque d'Etude et du Patrimoine
Bibliothèque de Toulouse
1 rue de Périgord, 31000 Toulouse
Tél : 05 62 27 63 76
-----Message d'origine-----
De : Katherine Don [mailto:kjdon@cs.waikato.ac.nz]
Envoyé : mercredi 13 décembre 2006 23:24
À : HERNEBRING Patrick Cc : greenstone-devel@list.scms.waikato.ac.nz
Objet : Re: hyperlink individual metadata elements
Hi Patrick
I have managed to get this going in my installation. I had to change
things slightly. Here is what I used:
### Self-made Javascript functions
{
function ExtractSubjects() {
var res;
var subject = document.getElementById("SubjectField");
a = subject.innerHTML.split(":");
resolver = a[0]+"&q=";
b = a[1].split("%3a%5c");
c = a[2].split("_");
res = "";
for (i = 0; i < b.length ;i++)
{
res = res + "<a href=" + resolver + b[i]+ "&fqf=DS&t=1>" + c[i] +
"</a> ";
}
subject.innerHTML = res;
}
}
Changes include the split value for a and b, the way the SubjectField is
referred to. Don't forget the package name.
My collection is using MGPP, so the query args changed from h=xx&t=0 to
fqf=xx&t=1. This may not apply to your case.
Hope this helps,
Regards,
Katherine
HERNEBRING Patrick wrote:
> Hi all,
>
> I?m trying to apply the Axel Schild?s method to hyperlink individual metadata elements but it isn?t working?
> Does anybody able to tell me what I?m making wrong?
>
> Here is a quote of my DocumentHeading format :
>
> {If}{[agt.Subject], <tr><td align=right valign=top><b>Sujet(s) :</b></td><td align=left valign=bottom><label name=SubjectField id=SubjectField>/cgi-bin/library?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-help-Patrick+Kinzley--00-0-1-00-0-0-11----0-0-&a=q;[cgisafe:sibling(All:' ;'):agt.Subject];[sibling(All:'_'):agt.Subject]</label></td></tr>}
>
> Here is a quote of my extra.dm in the macro directory :
>
> # header overridden for text pages
> _textheader_ {
>