Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am working on a project where I am creating a table of businesses. What I would like to do is have a 3 columns; 1 with the business title, 1 with the address, and 1 with the phone number. I have the table set up with the business title, but I do not see how, or if it is possible, to show the contents of the other fields that I created. If anyone has any insight into this problem, I would appreciate it.
Thank you.
Comments
Comment #1
KarenS CreditAttribution: KarenS commentedIt depends on what kind of module you are using to store this info.
If you are using cck fields in a cck node, cck creates the fields and they should show up automatically. If you are using fields from the location module, you need the location_views module which will make location fields available in views once it's installed. If you are using flexinode, you'll have to check the flexinode issues page to see if there is a views hook for flexinode (I don't know if there is or not).
If you have created a custom module, you will have to add a function called hook_views_tables (where 'hook' is replaced with your module name) that returns an array of fields that should be added to views. You'll need to review the views handbook to see how that works, or look at examples created in other modules (like the one in views/modules/node.inc).
Once you have done whichever one of the above is appropriate, you can create a new view, choose to display it as a table, and select the fields you want in the table.
Comment #2
mshaver CreditAttribution: mshaver commentedIs it possible to display multiple fields in a single column in the table view? Could this be done in template.php within the "phptemplate_views_view_table_VIEW_NAME" function?
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedYes. See the newest (as of today) theme wizard which will help you create theme functions to override individual fields in your table.
Comment #4
(not verified) CreditAttribution: commented