right now function _custom_links_build_links returns ALL links for one node type. What would be cool, is if it could return particular set of links to be used in template, panel or anywhere for that matter.

in my particular use case I have 7 node types as group posts and 3 group nodes - for posts I want 'edit/delete/comment/promote(flag)' links and for groups I want 'create (insert one of 7 post types) content'.

module needs one more argument in function, array of links i want returned and one if statement to see if link prepared is one i want. Then I could call from template something like this

return _custom_links_build_links($node, $teaser, $block, array(
  link_id_one,
  link_id_two,
  link_id_three,
));

and get links for particular node skipping ones I don't need in particular case.

CommentFileSizeAuthor
#1 custom_links-add_limit-918118.patch962 byteshenrijs.seso

Comments

henrijs.seso’s picture

StatusFileSize
new962 bytes

here is patch that adds possibility to limit links returned with and array of link_IDs. It will not brake existing code. It will allow to use custom links anywhere (template for example), not only in $links value of node object. You will be able to add 'edit' and 'delete' links under node body and some other set of links below title.

henrijs.seso’s picture

Status: Active » Needs review
henrijs.seso’s picture

Assigned: Unassigned » henrijs.seso