Hi,

I have a case (which I think should be similar to other people's) in which the 'Title' of the 'bio' object created is actually the name of the user... which, sometimes, the users put in their own username.

So, I wanted that, when the user creates its own bio node, the title be pre-filled with its username (I wanted the same for the email field, but that is easily accomplished with http://drupal.org/node/135045#comment-226885). Since the node title does not have a programmable "default" (as the other fields do), I decided to put this inside the bio module.

Since I don't expect this to suit everyone out there, I made it optional via a module setting variable and the default value to this variable is the same as if the option wasn't there in order to not change the behaviour of working sites unexpectedly.

Be warned that this patch also include the patch to fix permissions posted in http://drupal.org/node/135045, so you don't have to (and actually can't) apply both.

Comments

allie micka’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

Nice!

You're right, this is a bit too specific. We've accomplished the same goal in our install profile by adding first_name / last_name fields to our bio node. Then, we use the node autotitle module to set the bio node's title to "first_name last_name"

There's a configuration-based way of doing this and more, so I'm marking this "won't fix". However, it's probably worth discussing support for the token module to have this and other functionality built-in.

el_baby’s picture

That happens to me for not asking before I patch...

I tried auto_nodetitle and it works... what I miss from my patch is the ability to post-modify the auto-filled title... that is, maybe I use "baby" as my username, but I want my Bio's name to be "Mariano Absatz"... that I can't do with auto_nodetitle (and browsed the module's code and am not sure it can be patched to do so).

So the patch will stay here so I (and other people) can use it if I need it.

Regards.