[drupal-devel] [feature] Prefill 'path' field on new node form

leafish_paul drupal-devel at drupal.org
Wed Jul 27 16:22:12 UTC 2005


Issue status update for 
http://drupal.org/node/27155
Post a follow up: 
http://drupal.org/project/comments/add/27155

 Project:      Drupal
-Version:      4.6.0
+Version:      cvs
 Component:    path.module
 Category:     feature requests
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  jakeg
 Updated by:   leafish_paul
-Status:       active
+Status:       patch
 Attachment:   http://drupal.org/files/issues/path.module.wiki.style.create.page.at.404.patch (956 bytes)

Here you go, ready for voting.




leafish_paul



Previous comments:
------------------------------------------------------------------------

Wed, 20 Jul 2005 17:43:52 +0000 : jakeg

I'm creating wiki-like features on my site so that if someone with the
permission to create new pages goes to a 'page not found' page then it
gives them an option to create a page at that address (i.e. at that
path, so if they goto /somepath they can easily create a page with path
/somepath).


To do this its very handy for the 'path alias' field on the new node
page to be pre-filled with a value using e.g.
node/add/page?edit[path]=somepath in the same way that you can prefill
the title field using node/add/page?edit[title]=sometitle


I've got this to work by adding the following line to path.module at
line 211 as thus:


      case 'form pre':
        if(!$node->path AND isset($_GET['edit']['path']))
$node->path = $_GET['edit']['path'];
        $output = ...


... my line is the 'if' line in the middle above.


Could this be added to core? I'm sure others could find it handy and it
would save me from having to rewrite the line on every upgrade. If it
can't be added to core, is there anyway for me to put this line into my
own custom module somehow so that I don't have to rewrite it every time
I upgrade?




------------------------------------------------------------------------

Wed, 27 Jul 2005 16:18:31 +0000 : leafish_paul

Not a patch, but I quite like the idea.







More information about the drupal-devel mailing list