views links as images?

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by keesee on November 6, 2007 at 9:45pm

Hello,

I have a quick question regarding php and how views links are built. Here is the edit link code below. (views/modules/views_node.inc) How would I insert an image instead to say /modules/views images/edit.png? I'd love to add it as an option but it would conflict with the ability to enter the text you see on the front end. If someone would give me some assistance, I'd love to apply it where ever possible - view, comment, delete, edit etc... and contribute it back. I am new to php and eager to learn.


'edit' => array(
'name' => t('Node: Edit link'),
'handler' => array(
'views_handler_node_edit_destination' => t('Return To View'),
'views_handler_node_edit' => t('Return to Node')
),
'notafield' => TRUE,
'addlfields' => array('type', 'uid'),
'option' => 'string',
'help' => t('Display a link to edit the node. Enter the text of this link into the option field; if blank the default "Edit" will be used.'),
),
/**
* display a link to edit a node
*/
function views_handler_node_edit($fieldinfo, $fielddata, $value, $data) {
// try to build a fake node object
$data->type = $data->node_type;
$data->uid = $data->node_uid;
return l($link_text, "node/$data->nid/edit");
}
}

Thank you.

J.

Comments

Just create a new handler on

Posted by merlinofchaos on November 7, 2007 at 3:42pm

Just create a new handler on a dummy table that does your image.

Sweet! Thx!

Posted by keesee on November 13, 2007 at 11:09pm

Trying it out!.

J.

Whoa. hang on, that sounds

Posted by sime on November 13, 2007 at 11:20pm

Whoa. hang on, that sounds like a frighteningly simple solution to a problem I shelved a few weeks ago. Mind you I wouldn't be surprised given that merlinofchaos seems to have a knack of thinking of everything.

CorpX can you please post your solution when done? Would be great to refer back here when I tackle it again.

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /