By zzJames on
Hello,
I am trying to build a multinode userprofile based on the modules usernode + nodeprofile + nodefamily and I am struggling with the readme.txt documentation for nodeprofile; wolfram says:
* Theme your usernodes
If you have only one nodeprofile, just load the node view of your parent content
type of your nodeprofile, e.g. use this in your theme:$children = nodefamily_relation_load($nid); print node_view($children[0]);
simply put, I have no idea where this PHP belongs.
Thanks for any help.
p.s. I am a total drupal convert, expect big things as my site has a £300,000 budget from the London Development Agency!!!
Comments
theme function overrides
Perhaps you'll need to create a theme function override for usernodes.
Have a look at http://drupal.org/node/11811 - this will explain the process of overriding a theme function.
I hope this helps with your endeavors.
SOLVED: nodefamilly usernode display-use a custom node tpl file
hi
the answer is that it doesn't work if your usernode is just using plain old node.tpl.php (in your theme directory)
you must create 'node-usernode.tpl.php' which will become the template file for usernodes and ONLY usernodes. paste the code in here
Welcome to the wonderful
Welcome to the wonderful world of theme function overrides :)
Print nodeprofile data
James - any idea how to print nodeprofile data to the usernode?
That's what the code posted
That's what the code posted by the first person does, as long as a single nodeprofile type as been created use:
That goes in node-usernode.tpl.php which goes in your theme folder. The code will pull in the entire themed nodeprofile into the spot you put that code, if you want to theme nodeprofile do that separately with node-nodeprofile.tpl.php. Make sure to read the README.txt that comes with each module nodefamily, usernode, and nodeprofile, they will explain how to do all this also.
Thanks I always read the
Thanks
I always read the READ ME files. Often they are not very clear. I figured it out and it wasn't by using the code above. Maybe I wasn't being clear but I wanted to them the node_usernode.tpl.php file to bring in specific nodeprofile info in a specific order. I used contemplate which worked really well.
how about in drupal 5.x?
I'm trying to get this working in drupal 5 and I can't figure it out. Anyone have a quick solution?