Help displaying custom table(s) in Views using Views API

Hi All,

I have been struggling with Views API for the last 2 days and have decided to ask the community for some help.
Background: I have 3 custom tables in my database that are filled with data from CSV files from an external source, I am attempting to expose some columns of these tables as fields to Views so that I can display them on the website. These tables have no relationship to nodes, however I have a linkage table that relates the users table (uid) to the primary key of one of the tables - bringing that relationship into views will be needed later on when I overcome the hurdle of just getting fields to display.

The install schema for the table I'm trying to use:

  $schema['mytable'] = array(
    'description' => t(''),
    'fields' => array(
      'cust_id' => array(
        'description' => t(''),
        'type' => 'serial',
        'length' => '11'
      ),
      'cust_num' => array(
        'description' => t(''),
        'type' => 'int',
        'length' => '11'
      ),
      'cust_name' => array(
        'description' => t(''),
        'type' => 'varchar',
        'default' => 'NULL',
        'length' => '255'
      ),
    ),
    'primary key' => array('cust_id'),
  );

What I have coded up at the moment (I have tried lots of other things too, although this is probably the cleanest way to show my problem)

Deleting all the revisions including current revision

Hi,
If we are not creating the node revisions so I think there is no use records of DB table field_revision_field_* . If I delete the records (including current revision) from this table , then is no bad effect on node view page.
So in my opinion if we delete records from the field revision table, we can save so much DB space.
Friends... I want your views about it.

-- BP Chauhan

Node Author contact form

I need to create a block which links to the personal contact form of the specific node a visitor is viewing. I have tried multiple options like (1) Display suit with custom block (2) Custom "View" using Author entity

The code I used for custom block is

global $user;
global $node
php print $node->uid;

It prints the UID of the admin and not the node creator. Would appreciate any pointers

m:ss.pp time format

Hi,
Working with Drupal 7.
I need to save time (time only, no date) in format mm:ss.dd (15:85.65 )
Unfortunately I could not find the way how to do that. HMS module looks ok, but it has no seconds parts.
Any suggestions ?
Thanks.

page-node-n.tpl.php overriding custom header in page.tpl.php

I am using a multi-site set up, but the same problem could occur for a single site.

My set up is:

Multisite global theme:
- html.tpl.php
- - page.tpl.php

Subsite theme:
- - - page--node--2.tpl.php
- - - page--node--3.tpl.php

Page--node--n.tpl.php both have a lot of custom, non-Drupal PHP in.

What I want to achieve:

Year another mysterious error message

After checking out of existing project based on D7 on a new dev environment following error message has appeared:

Fatal error: Cannot access empty property in includes/common.inc on line 7594

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x