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.
Hi,
I have my feed working now. The "home"-feed builds feed-item from it.
What I would like is that the feed-items will have immediately a node weight of -20 (in my case will they be shown first then on views).
How can I program this. I tried additing on the bottom of the following code in simplefeed_item.module
// create a feed item node
$$node->url = $link;
$node = array('type' => 'feed_item', 'iid' => $iid);
$values['title'] = $title;
if ($date) {
// "created" is a node property, however we have to use "date" to set this with drupal_execute since it is the form element name
$values['date'] = $date;
}
$values['name'] = db_result(db_query('SELECT u.name FROM {node} n INNER JOIN {users} u ON n.uid = u.uid WHERE nid = %d', $process_feed->nid));
$values['format'] = variable_get('simplefeed_format', 1);
// $item->get_description() for teaser?
$values['body'] = $body;
$values['expires'] = $process_feed->expires;
$values['url'] = $link != '' ? $link : $feed->get_permalink();
$values['fid'] = $process_feed->nid;
$values['taxonomy'] = $item->taxonomy;
Adding the following line on the bottom of this:
$values['weight'] = -20;
Off course I enanbled the weight.module first.
But it doesn't work. ....
I don't want the parent-feed be given the weight -20, so I want to program it on feed-item building.
Can somebody help please?
Thanks in advance,
greetings,
Martijn
Comments
Comment #1
m3avrck CreditAttribution: m3avrck commented