An simple dropdown where links can be added
Asked by Wiki Support:

Hello,

I would like to ask you, if you can provide an user macro that would make it possible to create a simple dropdown where the user can fill in the title and add elements for the dropdown (in edit mode). I would need that links could be used. I found several macros, but either there was no option to add dropdown elements for the user himself or a link could not be used. Maybe it could be like a dropdown made of buttons (links), of course it has to be filled in by the user in edit mode.

Thanks very much

Alex  
[](https://community.atlassian.com/t5/Confluence-questions/An-simple-dropdown-where-links-can-be-added/qaq-p/444675?attachment-id=966){#link_1186d2adeafc0b}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/242054/1/Dropdowntest.jpg){#display_1186d2adeafc0b_0}


Answers:
author: Stiltsoft Support
body: Hello [@Charles Licata](/t5/user/viewprofilepage/user-id/613428) and [@Wiki Support](/t5/user/viewprofilepage/user-id/66090) ,

I see that you haven't found a solution for your request here. So I could suggest a workaround for you. As I see it you need to create a noticeable clickable link on your Confluence pages. I believe Handy Button can work for your use case. It is one of many macros from our [Handy Macros for Confluence](https://marketplace.atlassian.com/apps/1214971/handy-macros-for-confluence-formatting-and-interactive-ui?tab=overview&hosting=server&utm_source=atlassian-community&utm_medium=answer&utm_campaign=handy-macros-traffic-sources&utm_id=1216111&utm_content=dropdown_with_links) app. You can also create drop down menus with its Handy Status but without a link attached.

Hope that could help you find a solution.


author: Nic Brough -Adaptavist-
body: A drop-down implies a pre-filled list, which doesn't really lend itself to links.

Have you tried using simply the \[ to create links?

comments: author: Wiki Support
body: Hi Nic,

as I am as green as a tree in this I did not try markup for my use. I try to describe it a bit, I want to create a user macro that allows the user to create a dropdown list which he can fill with links, that will be visible as button. One field could be URL and the other Title so he can name his link for the list. Sadly I was not successful with my custom code (as it was just glued together code I found)

If there would be a fee plugin which would do the same I would gladly use it. None I know did meet my expectation.

Alex


author: Nic Brough -Adaptavist-
body: Ok, I'm still lost on "dropdown" and "links" - a link is a free-form line of text that points to a resource somewhere else. A drop-down is generally a selection from a pre-set list of items.

The \[ link notation in confluence allows for links to be given names - for example [Mr Flibble](https://answers.atlassian.com/questions/38842016/answers/38842144/comments/38842173) links back here, and it can point at attachments or other Confluence pages without needing a full url.   

So I'm a bit stuck on imagining what you're looking for. Is it something that tries to construct a url for you? Like "select a server, a name and a string, and I'll generate a link to another system that uses that structure for its links"?


author: Wiki Support
body: The user has to be able to create that pre-set list of items in the user macro edit. You are right, it should be a link notation, but somehow the syntax does not work, if I use \[Google\|www.google.com\] it wont show at all in the macro. Maybe I use the \[ not how I should .


author: Nic Brough -Adaptavist-
body: I still don't grasp what you're trying to do with a drop down or list - what are you expecting it to give to the user?

When you put in a \[ you should get a menu pop-up - that can help a user construct the right syntax for a link - it makes suggestions based on their recent history and allows for a search


author: Wiki Support
body: Dropdowntest.jpg

This is an user macro that is made of two parts, first one that creates an dropdown. A second part that creates the elements to populate the dropdown. I search for a single macro that would have the same functionality. (the items in the dropdown are clickable links)


author: Nic Brough -Adaptavist-
body: I'm sorry, I still really don't get what you're trying to achieve with this.


author: Wiki Support
body: Hi Nic,

me again :smile: so to describe it I will show you my test dropdown,it is made in HTML but I would love to have it as a macro.

\<select id="foo"\>

\<option value=""\>Pick a site\</option\>

\<option value=<http://www.google.com>\>Google\</option\>

\<option value=[www.yahoo.com](http://www.yahoo.com)\>Yahoo\</option\>

\</select\>

\<script\> document.getElementById("foo").inchange = function () {if (this.selectedIndex!==0) {window.location.href = this.value; } } ; \</script\>

the User should be able to add a new Option(line) and the Name and destination of the line. So basically I need a dropdown menu that can have customizable links in it.

Thank you for your time,

Alex


author: Wiki Support
body: Hi Nic,

how do things look? Were you able to create such a macro or point me in the direction what commands to use?

Alex


author: Nic Brough -Adaptavist-
body: Sorry, I missed your last update. I think I can see what you're aiming for, but I don't see a use for it - a drop-down should provide a fixed list of options for a user to select from ( a user macro can implement those as options in its config) and a free-form url is a simple web-link that Confluence already supports. If a user needs a preset, get them to use the macro. If they need something that's not on the list, get them to use \[


author: Wiki Support
body: Hi Nic,

thanks for the fast answer, it would be great the user to use such a macro, but the issue is I don't have it. I want a macro that lets the user create a fixed list of options as a dropdown.

Alex


author: Nic Brough -Adaptavist-
body: You said you already do above.


author: Wiki Support
body: html code is not enough, I would need it in velocity, with the same functionality as the html. The user should be able to create the fixed list, not me in the macro body. Not all users are able to use a html preset for their needs, the focus is on user friendliness so a markup/velocity user-macro with a simple dropdown functionality is my goal.


author: Nic Brough -Adaptavist-
body: I really don't understand this now. Could you tell me what you expect a confluence user to see when they are **reading** the page you want to add this to, and what they get when they **edit** it?


author: Wiki Support
body: ![laugh](/html/@BEA1CC333F4D830F5303329D7DC07DE4/images/emoticons/laugh.png "laugh") when they edit it, they see an option to give the list a title, an option to add list items and an href value so links can be used. When they are reading it, they see a button , when clicked it will show a list aka. a dropdown. Like the html I pasted a few messages ago, just in markup/velocity.


author: Nic Brough -Adaptavist-
body: Ok, I can't see any way to do that in the view screen without some javascript hacking, but probably more important, I can't see any use for it. A button that shows a list in a document? Why?


author: Wiki Support
body: Hi Nic,

the macro should go to a page to create a menu of some sorts not a document ![laugh](/html/@BEA1CC333F4D830F5303329D7DC07DE4/images/emoticons/laugh.png "laugh")

I used the html code in the end to create a workaround, the user macro was to complex for me, so thanks for your time. Hopefully we can solve something again in the future, have a nice day

Alex


author: John Lord
body: I also have an exact need for this and i can't understand why you even care what his usage is? Every post you made is "why why why" and "i can't see the usage" Well in my case we have a client drowndown that we would like to turn into a link to the client's website. How's that for a usage?


author: Charles Licata
body: Apologies, deleted reply as this is the wrong forum to ask the question.


Tags: select-list