is missing, would be a useful addition to a great module!

Comments

apasaja’s picture

Title: "Link this field to its node" field option » Im looking for this too..
Version: 6.x-1.x-dev » 6.x-1.0

Im looking for this too...

I use this codes:

<a target="_blank" href="<?php print $data->node_link ?>">
<?php print $data->node_title ?>
</a>

...but the <?php print $data->node_link ?> is not works...

I have no idea how to link to the node.. and I need it open in new window

apasaja’s picture

Title: Im looking for this too.. » "Link this field to its node" field option

why the title changed? try to change it back..

Igal’s picture

Try following:
Add Node: Nid before custom field and exclude it from display.
Use this code in php customfield

<a target="_blank" href="<?php print '/node/' . $data->nid ?>">
<?php print $data->node_title ?>
</a>
apasaja’s picture

thanks for the reply..

but the target="_blank" not works. Its open in same window

When using only <?php print '/node/' . $data->nid ?>, it will show the same result

ain’s picture

This is not a very feasible solution SEO-wise. Reference to node ID isn't semantic. What's needed is he Pathauto reference.

matebublik’s picture

Hello!

Try the following:

print drupal_get_path_alias("node/" .$data->nid) ;

Welcome from Hungary! :)

ain’s picture

Status: Active » Closed (won't fix)

Yes, deployed that myself already, but forgot to comment here about it. Thanks for the snippet Mate!

Greets from Estonia!

gpk’s picture

Status: Closed (won't fix) » Active

Although #6 is a good workaround, the original feature request was for an option to be available from within the Views UI, much like for other Views fields.

ginga8’s picture

Status: Active » Closed (fixed)

I fixed it on my own. just a small change. Here is my outcome.


//print_r($data); 
$tenders = $data->node_data_field_file_field_file_fid;

	if( sizeof($tenders) > 1){
		print '<a href=/node/' . $data->nid .'>';
		print "Download and view";
		print '</a>';
	}else{
		print "Pick-up Only";
	}

//foreach ($tenders as $tender) {
//$tender = field_file_load($tender['fid']);
// echo $tender['filepath'] . '<br />';
//}

I found this helpful

print_r($data); 
gpk’s picture

Status: Closed (fixed) » Active
charlie-s’s picture

EXACTLY what I needed. I knew how to do the nid but it was worthless as all other references are to the path alias.

Thanks.