Hi all, how can i render field in node?
I tried this print render($content['field_pdf_detail_bytu']);

But didnt work. I need pdf file, but with another name link.

example>
<a href="link here">PDF</a>

Comments

andrea.cavattoni’s picture

Well the code you provided must work, but this is better:

hide($content['field_pdf_detail_bytu'];
print '<a href="'.str_replace('publc:/','/sites/default/files',$content['field_pdf_detail_bytu']['#items'][0]['uri'] ).'">PDF</div>;

this obiously in a node.tpl.php;)

tozix’s picture

Thanks a lot for answer. Is there some syntax error.

edit: Ok here is the ok code

hide($content['field_pdf_detail_bytu']);
print '<a href="'.str_replace('public:/','/sites/default/files',$content['field_pdf_detail_bytu']['#items'][0]['uri'] ).'">PDF</div>';

Again many thanks.

tozix’s picture

Hmmm this solution create from all "a" in node a link with link to pdf look here http://www.bubak.cz/london/?q=node/16

edit: my bad. is there div PDF

.ok works :)