I have a view which lists some nodes and I want a cu开发者_StackOverflowstom output for the title of the node. Im using customfield which allows me to write PHP code but I cant find how to output the link to the node? It doesnt appear in the $data object. I can add the field, but still cant use it in the customfield code
Rather than using Views Custom Field to load PHP into the database, consider modifying the views template for the title field. If you go to Theme Information, it'll give you the file hints for the field. Create the file in your theme, and modify the title that way.
This has the benefit of separating code from content, and if you do it this way, you can add the Note: Link field, exclude it from the display, and use it in the Title template you created.
Check out Group 42's Guide to Theming for more information.
精彩评论