Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-25689

Make the attachment macro more configurable to display longer file names

    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for Confluence Server. Using Confluence Cloud? See the corresponding suggestion.

      Right now, the attachments macro and the attachments page truncate the file name of an attachment when it is displayed on the webpage. It would be better if this was a configurable option that could be turned off, or the maximum number of characters configurable.

            [CONFSERVER-25689] Make the attachment macro more configurable to display longer file names

            emerson.loh added a comment -

            Hi Arthur,

            I am using Confluence ver 5.1.3.
            I tried the solution mentioned above by changing the length from 35->60.
            After the restart of the service, the name on the display still remained the same (truncated).
            Is there any other step missed out?

            emerson.loh added a comment - Hi Arthur, I am using Confluence ver 5.1.3. I tried the solution mentioned above by changing the length from 35->60. After the restart of the service, the name on the display still remained the same (truncated). Is there any other step missed out?

            I think this is pretty much the same as CONF-22002 so I'll close it as a duplicate and link it up. You might like to put a watch on that instead.

            John Masson added a comment - I think this is pretty much the same as CONF-22002 so I'll close it as a duplicate and link it up. You might like to put a watch on that instead.

            As we have problems displaying some long attachment names I reported this behaviour to Atlassian. I found a work-around by pathing the sourcesfile "attachments-table.vm"

            The code looks like this:

            <td class="filename-column">
            #parse ("/pages/includes/attachment_icon.vm")
            <a class="filename" href="$generalUtil.htmlEncode("${req.contextPath}${attachment.downloadPathWithoutVersion}")"
            title="$generalUtil.htmlEncodeAndReplaceSpaces($attachment.fileName)"
            data-filename="$generalUtil.htmlEncode($attachment.fileName)">
            $generalUtil.htmlEncode($generalUtil.shortenString($attachment.fileName, 35))
            </a>
            </td>

            I changed
            $generalUtil.htmlEncode($generalUtil.shortenString($attachment.fileName, 35))
            into
            $generalUtil.htmlEncode($generalUtil.shortenString($attachment.fileName, 65))

            I still think Atlasian should improve this coding/handling by using CSS text-overflow Property and NOT hardcoding some value.

            Arthur van der Molen added a comment - As we have problems displaying some long attachment names I reported this behaviour to Atlassian. I found a work-around by pathing the sourcesfile "attachments-table.vm" The code looks like this: <td class="filename-column"> #parse ("/pages/includes/attachment_icon.vm") <a class="filename" href="$generalUtil.htmlEncode("${req.contextPath}${attachment.downloadPathWithoutVersion}")" title="$generalUtil.htmlEncodeAndReplaceSpaces($attachment.fileName)" data-filename="$generalUtil.htmlEncode($attachment.fileName)"> $generalUtil.htmlEncode($generalUtil.shortenString($attachment.fileName, 35)) </a> </td> I changed $generalUtil.htmlEncode($generalUtil.shortenString($attachment.fileName, 35)) into $generalUtil.htmlEncode($generalUtil.shortenString($attachment.fileName, 65)) I still think Atlasian should improve this coding/handling by using CSS text-overflow Property and NOT hardcoding some value.

              jmasson@atlassian.com John Masson
              47df664813fd John Rimell
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: