Like freelinking.module, make the newly created node type from a wiki/goto link configurable. This is currently hard-coded to "story".

CommentFileSizeAuthor
#1 wiki.module.ema27.32 KBEmanueleQuinto

Comments

EmanueleQuinto’s picture

StatusFileSize
new27.32 KB

I try to introduce this feature but I'm just a Drupal newbe, maybe you can test.

1. Added this function for admin/settings

/**
* Settings for the Wiki module setting.
*/
function wiki_settings() {
  foreach (node_list() as $nodetype) {
    $newnodeoptions[$nodetype] = $nodetype;
  }
  $output .= form_select(t('Default for new nodes'), 'wiki_nodetype', variable_get('wiki_nodetype', 'story'), $newnodeoptions, t('Type of node that the wiki will create when clicking on a link without a target.'));

  return $output;
} // endfunction wiki_settings

2. Changed in function wiki_goto

  else {
    // We need a node type to link to if we're going to do this.
    // So I picked story, the most basic type of node.
    drupal_goto('node/add/story', 'edit[title]='. $dest_raw);
  }

to

  else {
    // using options
    $nodetype = variable_get('wiki_nodetype', 'story');
    $path = 'node/add/' . $nodetype;
    drupal_goto($path, 'edit[title]='. $dest_raw);
  }

Seems ok.

ema

moggy’s picture

personally, I'd be in favour of letting freelinking handle the links and leaving wiki to handle the rest of the wiki formating. Save duplicating work uneccessarily.