It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Dropdown menu in a table

Hi.

We are currently trying to create a wiki space where users are supposed to create documentation of the systems used in the company. We have a few tables and in some of the cells i want there to be a dropdown menu where there are predefined values for the users to choose from, for instance "Criticality" --> dropdown menu with High, Medium, Low etc.. So far i've been out of luck in my search to fix this, so any help would be greatly appriciated ;)

13 answers

1 accepted

4 votes
Answer accepted

You can add my suggestion to a template, but I'm not sure it's what you want. I can't find a drop down list macro, but there may be a 3rd party in the Marketpalce who make one.

Slightly ugly I know, but you could have a column heading for each level and put the tick box in the heading. All a user has to do then is tick the appropriate column.

Cheers.

I am so struggling right now for this drop down feature.

 

But yes, this kinda works but not to the desired effect.

 

Is someone in Atlassian listening?

You asked what I was looking for?  It would be great to have drop down menu and scroll bar menu as well.  

You can use Handy status macro (Handy Macros add-on) as a dropdown menu.

Hi Andrey, would you be able to supply a handy status macro for the cloud version?

Hi Paul,

Unfortunately, we have no plans for Handy Macros for Cloud at the moment. But you can vote for this here.

Just to clarify the reason: Cloud and Server add-ons require totally different approaches due to technical limitations on Cloud. There are not many requests to support Cloud right now (that's why we haven't planned this activity yet). But this is possible in the future.

You can really nickel and dime yourself to death on Confluence.  I'm working on a dropdown menu macro that'll do everything that Handy does… and will be free.  Coming in the next few weeks.

Like # people like this

Will this be available for Free in the Marketplace though?  Our team would welcome a simple and affordable (free) Add-On, but we'd require it to be available via the Marketplace so that it could can track it via licenses for updates, etc.

But either way Thank You for putting in the effort to find solutions for our Atlassian community.

Like # people like this

Yes.

I've worked at too many places, running projects, that can't have something stupidly simple as a damn calendar without shelling out $10/mo for it... on top of all the other nickels you have to shell out for Confluence.  In the end, you end up paying 2x or 3x more for Confluence just to make it worth using.  There's a good reason why Microsoft SharePoint still exists-- as expensive as it is, it is still cheaper than confluence.

And the source code will be posted too.

Like # people like this

Would love this functionality for the cloud version

Maybe our App Easy Dropdown Menu could be a solution. It can be found on the Atlassian Marketplace.

Regards,
Stephan (CEO of EPS Software Engineering AG, the vendor of the Easy Dropdown Menu)

Easy Dropdown menu is easy enough to use.  We have in-use on our downs.  It make confluence more like forms, instead of a wiki.

Note: The multi-select option for this is does not look like a traditional 'drop-down' menu, but at least there is a multi-select option.

Like Stephan Sutter likes this

Anders,

I've just done this, but I'm not sure it's exactly what you're looking for. This is what I made it work:

  1. Add the table.
  2. Insert the Expand macro.
  3. On the page in Edit mode, click on the Task List icon in the Toolbar (the one with the ticks).
  4. Add three of those and label them High, Medium, Low.
  5. Save the page.
  6. Now Click on 'Click here to expand'.
  7. Select whichever tick box is appropriate.
  8. Job done. :)

I tested it by navigating away from the page and back again via several others, and when I clicking on 'Click here to expand' the tick was still there, and where I wanted it to be.

Does that do the job?

Cheers.

PS, don't forget you can change the name from 'Click here to expand' to something more appropriate. :)

But it only works in the edit mode where you can edit the options on the check boxes and not when you publish the page.

Hi,

I can only do it for each cell. What I want though is to expand a whole row in a table.

How can I do that?

High, I'm having the same challenge 2 years after this thread, has anyone got any luck so far ?

(haven't tried it yet), but as it looks by your explanation i cannot do this when creating a global template? (Im using Confluence 4.2.11)

Here's an example:

h2.Application(s)

h3.<Application Name>

||#|||Item|||Information|||Comment||
|1|Appliaction Name / Version:| | |
|2|Number of users:| | |
|3|Criticality:| | | <--- Here's where i want a dropdown menu where the users can put in either "High", "medium", or "low"..
|4|Network:| | |
|5|Application type:| | |
|6|Vendor:| | |
|7|File paths:| | |

I'll give it a try ;) Not exactly what i wanted, but it'll have to do for now so i'll give you the answer on this one ;) Thanks for the feedback :)

Yes, it's a bit of a workaround isn't it? :)

Just another example of Atlassian community not providing the simplest of feature for page creation.  Give the cost of their licenses, you'd think they be able to provide a faster turnaround on some of these simple features like a drop-down menu option

Maybe you can use the simple HTML Drop Down list within HTML Macro:

<div>
<select name="Criticality">
<option value="high">High</option>
<option value="medium">Medium</option>
<option value="low">Low</option>

</select>
</div>

How and where do you implement this within Confluence?

EDIT the confluence page

there is a + sign for the Macros OR start typing {html so that the HTML Macro box is placed.

And paste the above code in that box

This solution is nice because it is simple, but I am failing to see how the value is saved from one session to the next.

Won't each session just repopulate the drop down with the top value (i.e. "high")?

Like Ian Bloor likes this

Hi Zohair, 

I am trying to implement the drop down to filter a confluence table. This table contains of two columns 1. Page title and 2. Category. 

What i want to achieve is to apply the drop down filter to the category and be able to filter based on that. 

When i add the code to the confluence html macro, i get the drop down, which is great but how do i link the drop down menu options with the table?

P.S i am very new to the world of coding so please bare with me :)

Regards,

Rohit

Hi Rohit,

You can use Table Filter macro with dropdown filter for this purpose.  See how it works on the demo site.

Like rohit patel likes this

Thanks for your suggestion Andrey. But i do not have the budget to purchase a plug in. I am looking for a work around maybe using a code?

Regards,

Rohit

Got a good solution from https://community.atlassian.com/t5/Answers-Developer-Questions/Creating-a-dropdown-user-macro/qaq-p/494678.

Need to create a new user macro like below. You can update $body.split("\n") ) to $body.split("</p>") ) if html content is used.

## @param DropdownId:title=Unique dropdown ID|type=string|required=true|default=1|desc=If more than one dropdown in page, change this to a unique name.
## @param Label:title=Label|type=string|desc=Enter dropdown label, if desired
#set ( $dropdownId = "" )
#set ( $dropdownId = "dropdown-" + $paramDropdownId )
#set ( $label = "" )
#set ( $label = $paramLabel )
#set ( $toplabel = "" )
#if ( $label == "" )
  #set ( $toplabel = "top-label" )
#end
#set ( $pageId = $content.id )
#set ( $options = $body.split("\n") )
<form class="aui $toplabel">
  <div class="field-group">
    #if ( $label != "" )
      <label for="$dropdownId">$label</label>
    #end
    <select class="select" id="$dropdownId" name="$dropdownId">
    #foreach ( $option in $options )
      #set ( $option = $option.trim().replaceAll('"', '' ) )  
      <option value="$option">$option</option>
    #end
    </select>
  </div>
</form>
<script>
AJS.toInit(function() {
  var canEdit = true;
  
  #if ( $permissionHelper.canEdit($userAccessor.getUserByName($req.remoteUser), $content) )
  jQuery("#$dropdownId").change(function() {
    var dropdownObject = this;
    jQuery.ajax({
      url: contextPath + "/rest/api/content/${pageId}/property/${dropdownId}",
      success: function(dropdownData) {
        dropdownData.value = jQuery(dropdownObject).val();
        dropdownData.version.number += 1;
        jQuery.ajax({
          contentType: 'application/json',
          type: 'PUT',
          url: contextPath + "/rest/api/content/${pageId}/property/${dropdownId}",
          data: JSON.stringify(dropdownData)
        });
      },
      error: function(response) {
        var dropdownData = {};
        dropdownData.key = "$dropdownId";
        dropdownData.value = jQuery(dropdownObject).val();
        jQuery.ajax({
          contentType: 'application/json',
          type: 'POST',
          url: contextPath + "/rest/api/content/${pageId}/property",
          data: JSON.stringify(dropdownData)
        });
      }
    });
  });
  #else
    canEdit = false;
  #end
  
  jQuery.ajax({
    url: contextPath + "/rest/api/content/${pageId}/property/${dropdownId}",
    success: function(dropdownData) {
      jQuery("#$dropdownId").val(dropdownData.value);
      if (!canEdit) {
        jQuery("#$dropdownId").prop( "disabled", true );
      }
    }
  });
});
</script>

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

What's New in Confluence Cloud – November 2019 Edition

Hey community! This month we’re excited to share brand new features to help you make your mark on Confluence. If you haven’t already, check out our updates from October and September too! Expre...

10,938 views 11 30
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you