Not all use cases need weights for order. In some cases you may not need a caption. It would be nice to toggle them on or off in the content type management settings.

I am creating a simple intranet form with several tables for work related schedule requests/changes. The table has sections already filled. In my case I created more than one table field. Weights and captions were not needed. They seem to make it a little confusing.

Only the first table was sort-able for some reason. The other tables had weights field selectors.

Example Before:
Form Before

Example After I wiped them out with CSS:
Form Updated

I looked through the code but got lost. It was quicker to modify the CSS for the theme that displays the content form.


/** Remove Dragable Handles and Weight Elements**/
.field-widget-tablefield .draggable a.tabledrag-handle {
  display:none; 
}

.tabledrag-hide {
  display:none;
}
/** Remove Caption **/
div[class*="-tablefield-caption"]{
  display:none;
}

It's a lovely module. The captions and reordering are really nice features. In my case just not necessary. Thanks for all the work.

Comments

mikeybusiness created an issue. See original summary.

lolandese’s picture

Hi Mike,

Thanks for the snippet with the needed CSS to hide the unnecessary form elements. That is indeed the easiest fix.

Giving extra options for toggling the actual rendering on or off through the HTML of the certain form elements might seem preferable but has the drawback of providing extra clutter on the field settings. Personally, I think that your solution is pretty okay.

Let's see if over time this thread gets more reactions with other people having the same need (also for D8). In that case, we might need to reconsider adding field settings options.

lolandese’s picture

Status: Active » Postponed
liam morland’s picture

Status: Postponed » Closed (outdated)

Drupal 7 is no longer supported. If this applies to a supported version, please re-open.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.