Show the date in Feedapi nodes

Designer - April 28, 2008 - 08:53

I am trying to show the date in nodes created by Feedapi:

I am trying to add the $date function to

function feedapi_node_link($type, $node = NULL) {
  if ($type == 'node') {
    if ($node->feedapi_node) {
      $result = db_query("SELECT n.title, n.nid FROM {node} n WHERE n.nid IN (%s) ORDER BY title DESC", implode(', ', $node->feedapi_node->feed_nids));
      $owner_feeds_num = count($node->feedapi_node->feed_nids);
      while ($feed = db_fetch_object($result)) {
        $links['feedapi_feed'. ($owner_feeds_num == 1 ? '' : '_'. $feed->nid)] = array(
          'title' => t('Feed:') .' '. $feed->title,
          'href' => 'node/'. $feed->nid,
        );
      }
      if ($node->feedapi_node->url) {
        $links['feedapi_original'] = array(
          'title' => t('Original article'),
          'href' => $node->feedapi_node->url,
        );
      }
      return $links;

Does anyone know how to do this?

Alternately. Is there a way to load an alternative node in the page.tpl.php?

Many thanks :)

Is $node->type the same as

Designer - April 29, 2008 - 15:14

Is $node->type the same as 'Content type' (in de content management administrator interface)?

o.k I am stumped.I have

Designer - April 29, 2008 - 15:31

o.k I am stumped.

I have tried:
node.tpl selection by if statement
Setting the content type weight
Creating feedapi_node.tpl.php

But none of these things are working.

The only thing I have gotten to work so far is if I add 'feed= 1' for example it wil show it in the original feed, but not in the created nodes.

According to everything I read one of these things should work. But I am not getting it to work. Mark me officially clueless. :)

This solves the issue:

Designer - April 29, 2008 - 16:22

o.k. this solved it:

Created a node-page.tpl.php and the feed nodes then defaulted to node.tpl.php.
The pages then route to node-page.tpl.php.

The simplest way to theme the feedapi node

GiorgosK - May 28, 2008 - 22:13

is creating node-feedapi_node.tpl.php
(save as .... from the node.tpl.php and start modifying)

feedapi_node is the "type" as displayed in admin/content/types/feedapi-node

more details here http://drupal.org/node/11816

------
GiorgosK
Geoland Web development / web marketing

o.k. I tried what you

Designer - May 28, 2008 - 22:29

o.k. I tried what you suggested, but it is not seeing it. The Feed feed_api content type is there.

I think what might be happening is that when the feed items get converted to nodes, it associates itself with node.tpl.php as a basic node.

The type for my setup is feedapi_node

GiorgosK - May 29, 2008 - 11:57

But you say your type is feed_api ?
then your file should be node-feed_api.tpl.php
check it again
------
GiorgosK
Geoland Web development / web marketing

 
 

Drupal is a registered trademark of Dries Buytaert.