Hello!

Please do correct me if this issue has already been addressed or is not an issue at all to begin with. I'm fairly new to Drupal and still working my way around most modules :)

I'm trying to create a website that requires a custom My Account page. To do this I created a content type, named it My Profile, and used Views and Panels modules to override the existing My Account page. In the content type settings I used ANT to get rid of the title field and automatically generate one using a token. I used [user-name] as token.

Everything works fine except that when a new user creates an account, instead of displaying his username in the My Account page, it prints Anonymous. After the user edits the details of his My Account page, the title displays the username correctly and is working ok.

I would expect that once the user creates an account, using ANT and the Token module, his username will be displayed immediately at the My Account page. Am I wrong to assume this or is this an existing problem, perhaps because of other module integrations?

Thanks so much,
Cecille :D

Comments

Kristina-2’s picture

I'm having something similar occur.

I'm using:
drupal 6.15
content profile 6.x-1.0-beta4
auto nodetitles 6.x-1.x-dev

When someone registers some of the fields from the user profile display and are required on registration. This creates the user profile.
The title is set to automatically become the user name of the author by using token [user-name] and to automatically generate the title and hide the title field.

Problem for me is the title generated ends up being "Guest" instead of the username. How could I fix this?

Kristina-2’s picture

I went and found out the variables on the registration page for the user name. I tried to use the ability to put PHP code in the Pattern for the title box.

The variable for the field for the username is $name = $form_state['values']['name'] so I tried 3 ways to do this. All of which gave fatal errors.

  global $form_values;
  $title = $form_values['name'];
  return $title;
  global $form_values;
  $title = $name;
  return $title;
  global $form_values;
  $title = $form_state['values']['name'];
  return $title;
Kristina-2’s picture

I fixed this on my site.

I first changed the config of automatic title.
It hides the title field, and generates the title.
The pattern for the title is: [author-name]

I also have rules installed.
I configured a trigged rule.
- After saving new content
- condition checks node type to see if it's a profile
- action it sets Set created content's title as [node:author-name]

It's doing exactly what I want now. The only thing auto nodetitles is really doing is hiding the title field. If I find a way to hide the title field I may be able to remove auto node titles completely since technically rules does exactly what I need except hiding the title field.

gaurav.kapoor’s picture

Issue summary: View changes
Status: Active » Closed (outdated)