I wrote a small tags module, currently with one new tag that allows to include titles from other nodes with the tag [#NodeID] (like include project issue numbers here).
This is senseful if you have terms in a text that are titles of other nodes and could be changed in future.
E.g. you write a book and each charakter has an own node: After you've written 500 pages the name of one person changes - so you change the persons node title and if the persons name is included as NodeID in the text the name changes automatically in the text, too. (maybe its necessary to rebuild the cache)
Just extract the archive and copy the file to /reptags/tags/.
Devs, please check for errors and design issues :) :
function _reptag_nodetitle_embed($nid) {
if ($nid && $node = node_load($nid)) {
if (node_access('view', $node)) {
$output = node_page_title($node);
if( $node->path ){
$output = '<a href="/'. $node->path .'">'. $output .'</a>';
} else {
$output = '<a href="/node/'. $node->nid .'">'. $output .'</a>';
}
return $output;
}
}
return '';
}
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | nodeadditiontags.zip | 944 bytes | Roi Danton |
| nodeadditiontags.zip | 559 bytes | Roi Danton |
Comments
Comment #1
Roi Danton commentedUpdated tags module.
1) It now supports embedding of node's title & values of content type fields.
2) Link to the terms node is added only if user has view access to the node.
3) Has Debug messages (if node/field not found).
The syntax is quite easy:
Comment #2
Roi Danton commentedI added two buttons to BUEditor to include Nodes and Fields with the syntax of this additional tags module:
#319014: Buttons: Automatically include node titles or textfields & embed them by NodeID with link
Comment #3
Roi Danton commentedFinally I've written a module for this task to support more editors in future. More information at Linodef.