Hi,
I'm still discovering Drupal, I mean, I'm fighting to understand the "nice" ways to use it.
Let's suppose I have a custom node type built with CCK :
- title
- body
- text field 1
- text field 2
When I display the node, I have all the fields one after another, such as :
title content
body content
field1
field2
1) displaying a node
Suppose my text field 1 is a link title and text field 2 is the URL. Can I display <a href="textfield1">textfield2</a>
with Views ? If yes how ? Or is Views not applicable to one single node and more applicable for "lists" (or tables, whatever) of nodes ?
I know there's a the link module and others that let me do this but it's for my general comprehension, this is a simple example to explain but I have to do more complex things.
For the moment I've chosen this solution :
- I created a node-mynodetype.tpl.php in my theme folder
- in this file I don't print $content
- instead I extract "manually" all the CCK fields and do what I want with them
Example :
$text = $node->field_text;
$text0 = $text[0];
$titlelink = $text0[value];
$text1 = $text[1];
$urllink = $text1[value];
print '<a href="'.$urllink.'">'.$titlelink.'</a>';
I have the feeling it's a "dirty" solution because of the dependency on the theme file.