Pass nodes in array on page into a views argument?

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by jdln on September 10, 2010 at 12:19pm

I have an array on my page that lists some node ID's. If I attach a view to this page, can I return those nodes in a view by using custom PHP code in an argument to ‘find’ this array?

I dont know a huge amount of PHP but using contemplate ive found the code that in a template file prints the node IDs.

<?php
foreach ($node->products as $myp_roducts) {
print
$myp_roducts->nid;
}
?>

Im trying to show other fields for these nodes. Some fields are in the array so i can print them with theming, but some fields that I need are not.

The reason I need to do this is im using a product kit in ubercart. A product kit contains multiple products, and i want to show their fields (price, weight, image, etc) on the product kit page.

The 'contained' products are not linked with a node reference so I cant use a node reference relationship, but im essentially trying to achieve the same thing.

In summary, I have an array on my page that lists the node IDs. Can I somehow show other fields for these nodes on this page?

Ive been trawling the ubercart forums for weeks trying to solve this. Their are a lot of threads but no solutions. If someone can help me with this ill happily write a how too guide for other ubercart users.

Thanks

Comments

Anyone?

Posted by jdln on September 13, 2010 at 11:08am

Anyone?

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /