1

I have GeoNetwork (v 3.0.4) and I want to add the Supplemental Information attributes to the default metadata view. How can it be done?

2 Answers 2

2

Following a post from amacar on the GeoNetwork user list [1] I was able to place the supplementalInformation in the default metadata view. These are the steps I've done:

a) add Supplemental Information in /WEB-INF/config-lucene.xml, in the dumpFields section

<field name="supplementalInformation" tagName="supplementalInformation"/>

b) add Supplemental Information in WEB_INF/data/config/schema_plugins/iso19139/index-fields/defauls.xsl

<xsl:for-each select="gmd:supplementalInformation/gco:CharacterString">
    <Field name="supplementalInformation" string="{string(.)}" store="true" index="true"/>
</xsl:for-each>

c) add Supplemental Information in catalog/views/default/templates/recordView.html

<div class="well"
     data-ng-bind-html="mdView.current.record.supplementalInformation | newlines"
     data-title="Supplemental Information">
</div>

With this I can see the supplemental Information text in a gray box, similar to the abstract box and right bellow it. What I'd like to do now is add a title before the supplemental information box. I tried using the data-title but that did not work.

[1] - http://osgeo-org.1560.x6.nabble.com/Extend-Default-Metadata-View-td5262029.html

1

After editing and testing recordView.html, I have some answers.

If you are trying to add custom title before supplemental information, you can just add h1 (heading) element before supplemental information div element. Your code would look like this:

<h1 data-ng-if="mdView.current.record.supplementalInformation">Custom title</h1>
<div data-ng-if="mdView.current.record.supplementalInformation" class="well" data-ng-bind-html="mdView.current.record.supplementalInformation | newlines"></div> 

I added "data-ng-if" conditionals (it's an AngularJS directive) to show title and supplemental information only if metadata contains supplemental information.

If you want to add title from metadata (ie. gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString), you can do it like this:

<table class="table table-striped">
  <tbody>
    <tr data-ng-if="::mdView.current.record.title">
      <th>Resource title</th><td><i class="fa gn-icon-{{mdView.current.record.type[0]}}"/>{{mdView.current.record.title || mdView.current.record.defaultTitle}}</td>
    </tr>
  </tbody>
</table>

Note: i used striped table here, you can use another html element if you want.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.