Ran into an issue with link_node on a project when trying to override node_links output: while link_node has theme functions, it does not implement hook_theme() and it does not invoke theme() to render output, making it impossible to override those theme functions.

Attached is a simple patch that makes the following changes:

  • implements hook_theme()
  • changes the invocations of theme functions to use theme()
  • a minor clean-up in theme_link_node_thumbnail (remove unused varaible)
  • renamed theme_link_node_thumbnail to theme_link_node_link, since thumbnail only makes sense when linking to nodes of type image. Since modules and themes could not override link_node's theme functions prior to this patch, this seems a good time to make sure the function name correctly reflects its use.
CommentFileSizeAuthor
node-link-theme.patch1.95 KBmr.baileys

Comments

TomChiverton’s picture

Issue summary: View changes
Status: Needs review » Closed (fixed)

Released