Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
6.x-2.x-dev
Component:
General
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
19 Nov 2009 at 19:27 UTC
Updated:
28 Sep 2010 at 02:45 UTC
Hello,
I can not display the name of the label.
I tried like this but it does not work (NULL):
<?php
print $node->field_type_moteur[0]['label'];
print $node->field_type_moteur[0]['label_name'];
print $node->field_type_moteur[0]['label_title'];
?>
Thank you for your help!
Comments
Comment #1
markus_petrux commentedWhere are you trying to executed that code?
Comment #2
markus_petrux commentedComment #3
Clément commentedIn my_block.tpl.php
My module:
Comment #4
markus_petrux commentedAh, ok. So, you need to read field information using CCK APIs. Try:
[EDITED] added check_plain() to the example above. Oops!
Comment #5
Clément commentedThank you for your professionalism and your speed!!!
Now it works.
It's just a little bit annoying because I must display the name of 50 labels ...
I'll try to make it simpler thing.
Comment #6
markus_petrux commentedBetter title.
Comment #8
spacereactor commentedI try the above
and only work with default language, but the label remain the same language when i switch to other language. I have already translate it to other languages for my label.
I trying to make a multi language site with custom node-content-type.tpl.php theme. Any help?
Comment #9
spacereactor commentedok solve it by change check_plain() to t()
But i need help to add in GROUP label. anyone?
Comment #10
beckyjohnson commentedHow would you add a space between the label and the field using php?
I did this:
But it didn't seem very elegant.
I tried this too:
and I just get php errors.
same with
and
Becky