Hello,

There is any way to integrate this module with views to be able to add the last published date and expiration date as fields on the table view?

Thanks,
Stefan

Comments

doc2@drupalfr.org’s picture

Quite interesting indeed, to manage the nodes and tracking them thanks to the capacity to track the "publishing memory".

rymo’s picture

Here's a quick snip you can append to node_expire.module to allow Expiration Date to appear in Views:

function node_expire_views_tables() {
  $tables['node_expire'] = array(
    'name' => 'node_expire',
    'join' => array(
      'left' => array(
        'table' => 'node',
        'field' => 'nid',
      ),
      'right' => array(
        'field' => 'nid',
      ),
    ),
    'fields' => array(
      'expire' => array(
        'name' => t('Node Expire: Expiration Date'),
        'help' => t('Date/time on which the node will expire.'),
        'sortable' => TRUE,
        'option' => 'string',
      ),
    ),
    'sorts' => array(
      'expire' => array(
        'name' => t('Node Expire: Expiration Date'),
        'help' => t('Sort by node expiration date.'),
      ),
    ),
  );
  return $tables;
}

Would be good to get a date formatting handler in there before making an actual patch - hopefully this will help somebody in the meantime. After editing the .module remember to empty your cache tables (maybe just cache_views?) or the new "Node Expire: expiration date" Field won't show up when editing a view.

Cheers,

- Ryan

brmassa’s picture

Status: Active » Fixed

Guys,

im marking this node as duplicate of http://drupal.org/node/282371 (despite the fact that one is newer). We will continue our discussion there.

regards

massa

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.