I'm trying to use:<?php print $node->field_url[0][view]; ?> in my template to bring up a web url field in cck. Nothing appears. I have tried doing the same with a plain text field with the same results. really can't see what is going on! Help would be vey much appreciated. All my other fields are working fine.

Comments

nevets’s picture

Not sure, but you at least need ['view'] instead of [view]. Also you could do a print_r($node->field_url) to see what is there.

sijuwi’s picture

Appears to be available. If I name a text field URL, it wont work, however if I name that same text field something else like 'test', it will work, however if I name the url field something like, 'weblink' instead of 'URL' it still won't work

Creazion’s picture

Hi sijuwi,

if you use the weburl field you must use the follow syntax to print it out

print $node->field_url['view'];

instead of

print $node->field_url[0][view];

Folkert’s picture

should you not use ?
print $field_url['view']

works for me.

karens’s picture

The problem is that this module was created back when the cck data structure was different and it never got properly updated. Whoever does the update of this module needs to be sure it handles data consistently with the other modules.

sijuwi’s picture

Thanx a million. This is driving me bananas though. In the beginning I spent ages working out that that fields could be called from [0][view]; not [view];, to find out now I would have to have done some reverse thinking to get the url to work. But I'm grateful anyway for the answer.

karens’s picture

If you're able to use patches, you might try the patch at http://drupal.org/node/64827.

killes@www.drop.org’s picture

Version: 4.7.x-1.x-dev » 6.x-1.x-dev

web url is only in cvs version.

karens’s picture

Status: Active » Fixed

Removed weburl from cvs, please use link instead (http://drupal.org/project/link). Weburl is not being maintained.

Anonymous’s picture

Status: Fixed » Closed (fixed)