By pacome on
Hello,
I need help to include some nodeprofile cck fields at the top of users blog. It will be used to put some infos about the author before his content.
I guess I have to work with a page-blog.tpl.php , but I don't know how to grab he nodeprofile field...
I also have to say that I'm a real dummy about php : I can copy & paste and adapt a bit, but that's all :)
Does someone has a suggestion ?
Thanks a lot.
Comments
just a post to bring this
just a post to bring this question back on the table :)
A good start !
Here is a first step : I did a node-blog.tpl.php file with the following code in it (directly form the nodeprofile readme file... ooops !)
It works, but too much : It prints the nodeprofile for each post !
I have to find a solution to display it only once, at the top of the page...
[edit] I think it's maybe because I used node-blog.tpl.php : I think it apply its content to every blog post (??)
So maybe the solution would be to put this code directly into page.tpl.php.
I've tried out, but it doesn't display anything... Any idea ?
inserting user's nodeprofile in his blog page
A friend found a solution : he used a page-blog.tpl.php file, wich set the whole page.
The file node-blog.tpl.php set each blog post, because each of them is a node... (of course !)
Here is the code we finaly use in page-blog.tpl.php :
And it works : we have the nodeprofile at the top of the blog page, with only the cck fields, and without the generic title..
von-p, thas code renders the
von-p, thas code renders the entire noprofile node, i thought you ere after rendering a cck field that is inside that nodeprofile, have you achived that?
Hello Leanazulyoro, yes it
Hello Leanazulyoro, yes it print all the nodeprofile node ; it works, but it's not a clean solution..
I don't know how to render a specific field from a cck content (and especially from nodeprofile), and I would really appreciate to find a way to do it. For exemple, I need to do that to customize a blogger block list (from blogger module), and to display the 'name' field from nodeprofile instead of the username. (http://drupal.org/node/229760)
If you know something about that, please let me know !
I have just posted a more
I have just posted a more general aproach of this post in the cck issues (http://drupal.org/node/235048).
There i ask for a way of printing out a cck field from an specific node into another node. this way we should be able to reference that "specific node" to be the nodeprofile of the author of the node in which we plan to print the field.
I did it, but...
von-p, i have a found a way around to do this, but i'm not an advanced drupal developer and the solution involves extracting the desired data directly from the database tables. So i share this solution but still wait for someone who can show us the "drupal" way of doing this.
This is what i've done:
PD: well this is my way of doing this, i repeat that i'm still waiting for a drupal way of doing this. i'm not a expert in php and mysql, probable someone with more experience could have done the same i did using only one sql query, so enhanments are welcome.
maybe a 'Drupal way' ?
I found something here : http://drupal.org/node/171160 and here : http://drupal.org/node/232427
The first one seems to be for a more general purpose (to put a cck field in page.tpl.php), so it should be almost the same for a page-blog.tpl.php.... Maybe it is the "drupal way" to do it, that you were talking about ?
The second one is more specific (printing a cck field in a calendar) so there is maybe a starting point about my blogger block list.
I will try that..
an easy solution
Solution is to use Views + arguments, see : http://groups.drupal.org/node/18382#comment-63301
greetings!
-P-