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.
I have created a cck. which is parent to usernode. And usernode has a node reference to that cck.
I'm theming cck, here I'm trying to show all users which has refencer to a node of that cck. I have put this code in node-type.tpl.php.
<?php $children = nodefamily_relation_load($nid); ?>
<?php
foreach ($children as $childnode) {
print theme("username", $childnode)."<br/>";
print theme("user_picture", $childnode)."<br/>";
}
?>
It must show all users, who has refenrce to this node, but it is showing only first user.
--
Sharique
Comments
Comment #1
Sharique CreditAttribution: Sharique commentedHere is the more details abt my problem.
I have created 2 cck types.
One is for "school" entry.
Second is "user-profile", which is set to node profile. It contains a node reference to school type node.
There are two relations
1. Usernode-> User Profile
2. School-> Usernode
I have created 4 users
1. admin-> belongs to first school (http://test.tausifuddin.com/user/1)
2. test -> belongs to second school (http://test.tausifuddin.com/user/2)
3. test1 ->belongs to second school (http://test.tausifuddin.com/user/3)
4. test2 ->belongs to second school (http://test.tausifuddin.com/user/4)
I have created custom tpl file for schoole type node. Which shows all users which has reference to that list (using node relation ship[2. School-> Usernode])
I have put this code in node-school.tpl.php
Now the problem is that, it showing only one entry, which is author of school node not the list of users who has referenced this school node.
[http://test.tausifuddin.com/node/7]
--
sharique
Comment #2
fago? nodefamily has nothing to do with cck nodereferences.
Comment #3
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.