From | Belanger, Arthur |
Date | Tue Oct 13 08:00:02 2009 |
Subject | [greenstone-users] Classifier macros |
Hi.
I am trying to find a way to test in a classifier format statement (e.g. CL2Vlist) which level the current node is in. I have used [numleafdocs] to determine whether the current node is a document or a node but that is insufficient. The only way that I have figured out thus far is to parse CL3.8.10. Are there any macros that can be used to tell me where in the classifier list the current node is? That is, if CL3.8.10 is CL2.3.10, the macro should tell me that I am at level 3 (or 2 depending on how you count). Similarly, if CL3.8.10 is CL2.3, it should return 2 (or 1 dependiong on how you count). I haven't been able to identify such a macro. So, I have written a javascript function to parse CL3.8.10 and return the right number but I haven't been able to test against the value though I can display the value on the page. I have put the script in in the collection's extra.dm file. I call it in a macro (_Classifiernode_) but I can't test against it. I am not a javascript programmer so I am probably missing something rather simple. Here is the javascript: function CLfoot(CLstr) {
Here is the macro: _classifierNode_ {
My format statement includes: {if}{_classifierNode_ == 2,Second Level,Third Level)
Thus, if _cgiargdl_ = CL2.4, _classifierNode should be 2 and "Second Level" should be displayed.
The _classifierNode_ line does produce the correct number but it is not actually the value of the macro. So, what I would like is to have _classifierNode_ be either 2 or 3 as:
I suspect that the document.write statement is not the proper way to pass a value back and/or Greenstone does not support such dynamically generated macros. Any help would be greatly appreciated. Thanks. Thanks. Arthur Belanger
(203) 785-6928
mailto:Arthur.Belanger@Yale.Edu
-------------- next part --------------
|