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

  • Home
  • SEARCH
  • 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 1027723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:16:48+00:00 2026-05-16T12:16:48+00:00

I have a table that’s been created by a module. I need to include

  • 0

I have a table that’s been created by a module. I need to include some of its fields into an existing view.

I tried using the table wizard module, but all it does is create a separate view for that table. I’d like to be able to choose fields from that table to be added into an existing view as additional fields, or through relationships or something like that. Is there a workaround to do what I’m trying to do?

  • 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-16T12:16:48+00:00Added an answer on May 16, 2026 at 12:16 pm

    Ah. Views. Took me a while as well. This answer is for Drupal 6 and in the abstract shows how to define fields as well as using a relationship to allow the fields to link to the node table.

    Inside modulename.module, you want a function that goes:

    function modulename_views_api() {
      return array(
        'api' => 2,
      );
    }
    

    Then you want to make a file called modulename.views.inc and define a function like this:

    function modulename_views_data() {
        $data['modulename_table'] = array(
            'table'     => array(
                'group'     => 'ModuleName',
                'title'     => 'Module name title',
            ),
            'join'  =>  array(
                // to join to node, we'll use a field in modulename_table called 'nid'
                'node'      => array(
                    'left_field'    =>  'nid',
                    'field'         =>  'nid',
                ),
            ),
        );
    
        // now we define the fields in the table like this
        // check out modules/views/handlers to see more specific handlers
    
        $data['modulename_table']['fieldname'] = array(
            'title'     => 'fieldname',
            'help'      => 'fieldname description',
            'field'    => array(
                'handler' => 'views_handler_field',
            ),
        );
    
        $data['modulename_table']['nid'] = array(
            'title'     => 'related node',
            'help'      => 'the field that relates back to {node}',
            // here we implement a relationship to nid
            'relationship'  => array(
                'base'      => 'node',
                'field'     => 'nid',
                'handler'   => 'views_handler_relationship',
                'label'     => 'modulename row node',
            ),
            // this relationship can be turned on in views
        );
    
        return $data;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that got into the db_owner schema, and I need it
I have a table that stores data that has been entered regarding the amount
I have a table that I need to update where all columns are optionally
I have table that gets dynamically created. When using jQuery and toggle, everything works.
I have a table that currently has two columns per row and I need
I have table structures that include a composite primary key of id & revision
I have table that contains more than 12 millions of rows. I need to
I have a table that contains some user data: user_id | guest_id | time_seen
I have a table that contains form elements that I need to replace if
I have table that shows some records from database. each table has a column

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.