docs: public static String shortenString(String text, int maxLength) {
  
          if (text.length() <= maxLength) {
              return text;
          }
          String newText = text.substring(0, maxLength - 1);
          if (text.startsWith("/")) {
              // file name?
              newText = CmsStringUtil.formatResourceName(text, maxLength);
          } else if (maxLength > 2) {
              // enough space for ellipsis?
              newText += CmsDomUtil.Entity.hellip.html();
          }
          if (CmsStringUtil.isEmptyOrWhitespaceOnly(newText)) {
              // if empty, it could break the layout
              newText = CmsDomUtil.Entity.nbsp.html();
          }
          return newText;
      }