Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 895795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:37:01+00:00 2026-05-15T14:37:01+00:00

Is there a clean way to remove the draggable option on multiple-value CCK fields?

  • 0

Is there a clean way to remove the draggable option on multiple-value CCK fields? I assume I could style it out with CSS but that doesn’t seem like the “right” way to do it.

Ideally, the draggable option wouldn’t be available for any users except admins.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:37:02+00:00Added an answer on May 15, 2026 at 2:37 pm

    Thanks for the tip @Andrew. Here’s what I ended up coming up with:

    function stannes_content_multiple_values($element) {
        global $user;
        $field_name = $element['#field_name'];
        $field = content_fields($field_name);
        $output = '';
    
        if ($field['multiple'] >= 1) {
            $table_id = $element['#field_name'] .'_values';
            $order_class = $element['#field_name'] .'-delta-order';
            $required = !empty($element['#required']) ? '<span class="form-required" title="'. t('This field is required.') .'">*</span>' : '';
    
            $header = array(
                array( 'data' => t('!title: !required', array('!title' => $element['#title'], '!required' => $required)), 'colspan' => 2)
            );
    
            if ($user->uid == 1) {
                $header[] = t('Order');
            }
    
            $rows = array();
    
            // Sort items according to '_weight' (needed when the form comes back after
            // preview or failed validation)
            $items = array();
            foreach (element_children($element) as $key) {
                if ($key !== $element['#field_name'] .'_add_more') {
                    $items[] = &$element[$key];
                }
            }
            usort($items, '_content_sort_items_value_helper');
    
            // Add the items as table rows.
            foreach ($items as $key => $item) {
                $item['_weight']['#attributes']['class'] = $order_class;
                $delta_element = drupal_render($item['_weight']);
                if ($user->uid == 1) {
                    $cells = array(
                        array('data' => '', 'class' => 'content-multiple-drag'),
                        drupal_render($item),
                        array('data' => $delta_element, 'class' => 'delta-order'),
                    );
                } else {
                    $cells = array(
                        drupal_render($item)
                    );
                }
                $rows[] = array(
                    'data' => $cells,
                    'class' => 'draggable',
                );
            }
    
            $output .= theme('table', $header, $rows, array('id' => $table_id, 'class' => 'content-multiple-table'));
            $output .= $element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '';
            $output .= drupal_render($element[$element['#field_name'] .'_add_more']);
    
            if ($user->uid == 1) {
                drupal_add_tabledrag($table_id, 'order', 'sibling', $order_class);
            }
        } else {
            foreach (element_children($element) as $key) {
                $output .= drupal_render($element[$key]);
            }
        }
    
        return $output;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a UIButton with multiple Gestures. Is there a way to remove ALL
Is there a (clean) way to manipulate some text from std::cin before inserting it
Is there an easy/clean way to do this in Linux/ a Linux-like environment? Purpose
I know there is a clean way to map a function f:A => B
I'm sure there's a clean way to do this, but I'm probably not using
I would like to know if there is a clean way to do git-svn
Is there some clean and elegant way to execute my code right after a
Is there a simple and clean jQuery way to find the element who a
Is there an smart way of unqualifing (clean namespaces references) a XML in c#?
Is there a recommended way of using Django to clean an input string without

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.