How can I understand function what make it work with node is:
function alinks_nodeapi(&$node, $op, $teaser, $page) {
switch ($op) {
case 'view':
$node_types = in_array($node->type, variable_get('alinks_node_types', array()), TRUE);
if ($node_types) {
drupal_add_css(drupal_get_path('module', 'alinks').'/alinks.css');
$words = alinks_get_strings();
if ($words) {
$node->content['body']['#value'] = alinks_make_links($node->content['body']['#value'], $words);
}
}
break;
}
}
Somebody know how must be look like function for working with fields in views?
Comments
Comment #1
Anonymous (not verified) commentedOK I will try and answer.
First, in general Views does not have fields, but does output fields from other content types.
I am assuming you have a View which displays several nodes, and you want alinks to attach to the displayed content?
If this is the case, all you have to do is theme the view
You will need to create views-view--page.tpl.php in your theme directory, using the code provided as the default for this in Views theme information "Display Output". NOte this affects ALL views, so you may wish to use one of the alternative template names to limit applicability
Now you will need to edit the code from
to look like this
You can also do a similar thing if you want to apply to the header or footer
Please note the code is not elegant, as I am no coder, but it works for me
Comment #2
pindaman commentedthis is NOT working for D7./
I really don't know php, but i got it wirking for Drupal 7.
create a views template "Style output"
paste standard php i there. Then replace
<?php print $row; ?>with
Comment #3
greg boggsOne way to do this is to output the body field in your view as a rendered entity.
Comment #4
greg boggs