Tripal v3 will come with a default Layout using panes similar to version 2. However, with Tripal v3 the default layout is not required. This tutorial will show you how to modify Drupals default layout which consists of a long listing of data using labels to include tables. No programming will be required.
If you don't have Tripal Panes enabled then the Drupal default is to simply list all the fields with the label and the value.
With some configuration and a couple of Drupal extension modules, you can flexibly arrange these fields into tables.
Installing Drupal Extension Modules
- Field Group: This module allows you to easily group fields together using markup.
- Field Group Table: This module provides a table format for the Field Group Module.
Simply install the above to modules as you would any other Drupal module. For instructions reference the Drupal.org Tutorial.
Configure your Page Display
The display of your pages is configured per Tripal Content Type. Go to Administration > Structure > Tripal Content Types and click the "manage display" link for your type. In this tutorial we are changing the display of the "Analysis" Tripal Content Type.
You will be shown the Display Management user interface. Each field is listed in the table and by default, Drupal allows you to set where to display the label (human-readable name of the field) or whether to hide it altogether using the drop-downs in the "Label" column. You can also specify a format for the value of the field in the "Format" Column. The fomats available depend on the type of field and the extension modules you have installed. Furthermore, the Field Group module adds the ability to add groups as indicated by the green arrow.
For each table you want displayed on your page you need to create a group. In this case, I want a table containng all the fields but the description so I created a single group called "Overview (group_overview)". For the type, you should select "Table". You need to click "Save" to create the group.
The group is created with a given set of defaults including using the group label as the Table caption. To change these click the gear/cog at the end of the row. In this case, I hid the label using "Label visibility", checked "Table row striping" and "Always show field label", which adds the labels of the fields to the first column of the table.
Then simply drag all of the fields you want in your table into the Overview group and order then to your liking. Make sure to click "save" or your ordering changes won't be saved! Notice that I also changed all the "Label" drop-downs to hidden. This is to ensure that the label isn't represented twice.
Then just go to a page of this type or create a new one to see your new display :-)