Dashboard > Atlassian Plugins > ... > Macros > attachment-options
  Atlassian Plugins Log In | Sign Up   View a printable version of the current page.  
  attachment-options

Added by admin , last edited by David Peterson on Sep 03, 2007  (view change)
Labels: 

{attachment-options}

Plugin: Scaffolding Plugin

Creates a set of list options linking to the attachments on the specified content the filter options.

Description

Must be contained inside a list-data macro.

Usage

{attachment-data:content=[content name]|filter=[file pattern]}

Parameters

Name Required Default Description
content
If specified, the page or other content the files are attached to. Defaults to the current page.
include
Only file names which match the specified regular expression will be displayed. E.g. ".*gif" for all GIF files. (Since Scaffolding 2.3-dr7)
exclude
Excludes any file names which match the specified regular expression. (Since Scaffolding 2.3-dr7)

David - Can't get this macro to work properly - 3 bugs we hit:

  • {attachment-options} -  when editing, you get the list of attachments properly, but the last one in the list is always selected when you first enter the edit Scaffolding data page.
  • even though when editing, you can select any of the available attachments, when you save the Scaffolding data, it selects the first one that was in the list every time.  (Not an off-by-1 error -- does the same thing regardless of how many attachments)
  • the "filter" param doesn't respect an ORed pattern like -- .*(jpg|jpeg|gif|png) -- unless my regex brain is hosed and got that wrong

Also, in the Usage section at the top of this page, should change "attachment-data" to "attachment-options".

We're using Scaffolding v2.2-dr3.  Any ideas? Thanks!

Hi David,

I'll have to check your first two issues - it's been quite a while since I actually used {attachment-options}, so it's possible a bug or two may have crept in...

As for the regex, Confluence interprets a '|' to mean 'next parameter'. As in {macro:param1=value|param2=value}. I'm not sure if I actually coded around that limitation for this macro or not, but often I use a double forward-slash ('//') as a substitute. You could try that. However, I have a feeling I haven't actually implemented it here...

Could you raise the first two issues as a bug (I'm guessing they're related) and the latter also as a separate bug? Thanks.

Sure. I'll log the first 2 in jira.

For the regex, I'm sure I tried escaping the "|" with "|" or something, but no luck.

>> with "|" or something, but no luck.

...that was a "(backslash)|" by the way.

Yeah, my life would be a lot simpler if Confluence's rendering engine let you escape stuff like '|', '=' and even backslash in macro parameters. Go ahead and add the regex problem also - I'll use one of my typical workarounds...

Copyright(c) CustomWare Asia Pacific Pty Ltd
Powered by Atlassian Confluence 2.7.3, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators