problem with theming cck

Sharique - November 8, 2007 - 17:53
Project:Node Family
Version:5.x-1.x-dev
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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

#1

Sharique - November 21, 2007 - 08:12

Here 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

<?php $children = nodefamily_relation_load($nid); ?>
    <?php
     
foreach ($children as $childnode) {      
        print
"Name:";
        print
$childnode->name."<br/>";
       
      }
  
?>

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

#2

fago - January 3, 2008 - 20:51
Status:active» fixed

? nodefamily has nothing to do with cck nodereferences.

#3

Anonymous - January 17, 2008 - 20:52
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.