[greenstone-devel] hyperlink individual metadata elements

From HERNEBRING Patrick
DateTue, 5 Dec 2006 15:50:42 +0100
Subject [greenstone-devel] hyperlink individual metadata elements
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>_httpquery_;[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_ {_cgihead_
_htmlhead_ (onload="ExtractSubjects();")
<center>
<table width=537><tr><td align=right>
_icontab__javalinks_</td></tr></table>
</center>
_startspacer_

<!-- document:textheader -->
<div id="banner">
<div class="pageinfo"><p class="bannerlinks">_globallinks_</p></div>
<div class="collectimage">_imagecollection_</div><br></br><br></br><br></br><table align="right"><font size="2"><a href=_httpprefix_/_httpcurrentdocument_&l=fr&w=utf-8>Français</a> | <a href=_httpprefix_/_httpcurrentdocument_&l=en&w=utf-8>English</a> | <a href=_httpprefix_/_httpcurrentdocument_&l=zh&w=utf-8> 中文</a></br></table></font>
</div>
<div class="bannerextra">_pagebannerextra_</div>
}

### Self-made Javascript functions
_pagescriptextra_{
function ExtractSubjects() {
var res;
a = SubjectField.outerText.split(";");
resolver = a[0]+"&q=";
b = a[1].split("+%3b+");
c = a[2].split("_");
res = "";
for (i = 0; i < b.length ;i++)
{
res = res + "<a href=" + resolver + b[i]+ "&h=da1&t=0>" + c[i] + "</a><br/>";
}
SubjectField.outerHTML = res;
}
}

Any help or advice is greatly appreciated.


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