Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Simple macro to insert image from remote server

Сергей Рябенко
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 16, 2018

Hello, I want to create a macro to list and insert selected image from my server into confluence page. I can do some Java coding, especially with examples provided, but currently I stuck looking for right examples.

My questions are: 

- How do I remove left panel in macro dialog?

- Can I make dialog content an iframe?

- How do I insert selected image (considering image and "Insert" button are just HTML inside dialog)?

Thanks for help in advance.

 

2 answers

0 votes
Сергей Рябенко
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 28, 2018

Hi Zak,

thanks for your reply, I'll check this.

0 votes
Zak Laughton
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 27, 2018

Hi Сергей!

I understand you'd like to create a user macro that lets users select from a group of images and insert it onto a Confluence page.

To answer your specific questions:

  • How do I remove left panel in macro dialog?
    I don't believe this is possible. The left panel in the dialog for the macro will always be present, even with no parameters specified.
  • Can I make dialog content an iframe?
    There's not a way I'm aware of to use an iframe in the macro dialogue.
  • How do I insert selected image (considering image and "Insert" button are just HTML inside dialog)?
    I'm not quite sure what you're referring to here with the image and insert button. Hopefully though, the example below might clear some things up.

I created this quick user macro that lets a user choose from a list of image files and show the image on the page. You can replace the imgur address with a path to your server, and the file names with actual files, and you will have a list of files to insert in a macro in Confluence:

## Macro title: Remote image list
## Macro has a body: N
## Body processing: No macro body
## @param filename:title=Image|type=enum|enumValues=LRoLTlK.jpg,4AiXzf8.jpg,Xc1QTk8.jpg

<img src="https://i.imgur.com/$paramfilename">

More helpful examples can be seen at the bottom of Writing User Macros and User Macro Template Syntax.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events