An simple dropdown where links can be added

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

1 answer

0 vote

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?

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

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 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"?

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 .

 

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

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)

I'm sorry, I still really don't get what you're trying to achieve with this.

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>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

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

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 [

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

You said you already do above.

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.

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?

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.

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?

Hi Nic,

the macro should go to a page to create a menu of some sorts not a document 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

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published yesterday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

72 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you