在上面,“DDC 主题”下的项目显示为'::' like -> "DEWEY DECIMAL CLASSIFICATION::GENERALITIES::Bibliography (1)",我想显示为 -> "Bibliography (1)"。为此,我在文件[dspace-install]/webapps/xmlui/static/js/discovery/search-control.js ->中编写了以下脚本
function cutText(){
var headvalue = $('div#aspect_discovery_Navigation_list_discovery ul li h2').innerHTML;
if(headvalue.match('DDC Subject')){
var displaytext = $('#aspect_discovery_Navigation_list_discovery ul li ul li a').innerHTML;
var y = displaytext.split("::");
if(y.len>1)
var display = y[y.len-1];
alert(display);
$('#aspect_discovery_Navigation_list_discovery ul li ul li a').innerHTML = display;
}
}
但它不起作用。任何人都可以帮忙吗?
接受@euler的建议现在我已经完成了以下操作-> 我已经使用以下内容修改了 dspace.cfg文件->
choices.plugin.dc.subject.ddc = ddcE
choices.presentation.dc.subject.ddc = lookup
vocabulary.plugin.ddcE.hierarchy.store = false
vocabulary.plugin.ddcE.hierarchy.suggest = false
vocabulary.plugin.ddcE.delimiter = "::"
并且“ ddcE ”在我的input-forms.xml文件中定义,例如 ->
<field>
<dc-schema>dc</dc-schema>
<dc-element>subject</dc-element>
<dc-qualifier>ddc</dc-qualifier>
<!-- An input-type of twobox MUST be marked as repeatable -->
<repeatable>true</repeatable>
<label>Subject (From DDC)</label>
<input-type>twobox</input-type>
<hint>Enter appropriate subject Division/Sub-division from DDC 23rd Edition(upto 3rd Summary)</hint>
<required>You must enter at least one Division/Sub-division from DDC 23rd Edition(upto 3rd Summary)</required>
<vocabulary>ddcE</vocabulary>
</field>
但现在它在重新启动 Tomcat 后也没有反映任何内容。