Attachment display

Hello,

I want to display an attachment as a table of content, but for some reason the size appears also in the file name. How can I remove it from the title?

attachment

Thanks in advance,
Ioannis

Hello Ioanni,

Can you provide a link of the table?

Kostas

I had a look and It seems that it is a bootstrap theme issue. The CERN theme inherits templates from the Bootstrap theme and as a result it inherits the faulty template too.

I can propose two solution:

  1. In order to fix it globally you can override the theme template of bootstrap that causes the issue. In this case the template is the file-link.html.twig. What you can do is to install CERN Override theme and then add /templates/file-link.html.twig file in CERN Override. In the new file copy-paste the markup of file-link.html.twig and just remove the size definition. In your case remove <span class="file-size">{{ file_size }}</span> and its done. From now on, whenever you display a file as a link, the size will not render.
  2. In order to fix it only for this case, you can just add some css definitions using CERN Override theme. More specifically you can add:
// its in SCSS
table{ //all tables
   .file{    // all tables that display files
        .file-size{ 
             display: none;  // do not display the file-size field
        }
   }
}

The Size column does not have the .file-size class so it will be displayed.

Let me know if that works for you.

Kostas

1 Like

Thank you Kostas,

I used your first sugesstion and it work for me.

Ioannis