0

In geonetwork I have truncated metadata file title when I do a search. Sometimes it is only a few characters that are missing so I try to increase the number of characters that can be displayed. in the gn_search_default.less file located in /catalog/views/default/less folder there are the options for the title.

gn-md-title {
      margin-top: 2px;
      min-height: 3.5em;
      max-height: 3.5em;
      overflow: visible;
      cursor: pointer;
      h3 
      {
    /* Leave space for selection checkbox */
    //padding-left: 40px;
    margin-top: 0px;
    a {
      //text-transform: uppercase;
      font-weight: normal;
      font-size: 80%;
      color: #333333;
      max-width: 800px;
      overflow: visible;
    }

    a:hover {
      color: #428bca;
      text-decoration: none;
    }
  }
}

I can change the font-size percentage for instance but the max-width has no effect. I removed the text-overflow: ellipsis option and set overflow: visible. However it has no effect on the displayed length of the title.

Here is a screenshot of the website in Firefox.

Any idea how to modify that?

enter image description here

  • Could you add the link again, please? – Stefan Dec 19 '18 at 15:24
2

You cannot change the truncated title via CSS. As you can see in the following screenshot, the text of the <a> element is truncated programmatically by the platform. (You can reach this view by right-clicking on the title and then choosing "Inspect element".)

Screenshot of a search in Geonetwork

The title attribute of the <a> element describes the tooltip that appears when you hover over the <a> element.


That said, you can easily remove the truncation by editing catalog/components/search/resultsview/partials/viewtemplates/grid.html. Simply change line 65 from

<a data-ng-href="#/metadata/{{md.getUuid()}}"
  title="{{md.title || md.defaultTitle}}">
  <i class="fa gn-icon-{{md.type[0]}}" title="{{md.type[0] | translate}}"/>
  {{(md.title || md.defaultTitle) | characters:80}}
</a>

to

<a data-ng-href="#/metadata/{{md.getUuid()}}"
  title="{{md.title || md.defaultTitle}}">
  <i class="fa gn-icon-{{md.type[0]}}" title="{{md.type[0] | translate}}"/>
  {{(md.title || md.defaultTitle)}} <!-- remove the "character" modifier -->
</a>
  • that's sad... Thx – Nicolas deville Dec 19 '18 at 15:13
  • See my edit. I don't really know Geonetwork, but you will have to rebuild the platform in some way if you modify the HTML. – Stefan Dec 19 '18 at 15:30
  • 1
    Yes that could make the trick. I need to think about possible erase of my changes when new version of geonetwork are release though. Thanks for your time. – Nicolas deville Dec 21 '18 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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