Contextual is set up to display all content from a user for a specific content type.
www.example.com/users/realname/gallery where realname is contextual filter.
Realname is used with token that reflects field from registration: field-choose-realname.
Lets say we have 2 users and 1st writes "One" as realname and 2nd writes "One Two".
Realname contextual filter is setup to use lowercase and change spaces to dash.
Here is what happens:
www.example.com/users/one/gallery - ok
www.example.com/users/one-two/gallery - page not found error
www.example.com/users/one%20two/gallery - ok
For Contextual "when the filter is in the URL or a default is provided" i am using this php code (i did not write it so i have no clue what it does really):
if (!isset($argument)) {
return FALSE;
}
$query = db_query('SELECT uid, realname FROM {realname} WHERE realname = :realname', array(':realname' => $argument));
$row = $query->fetchAssoc();
if (isset($row['uid'])) {
return TRUE;
}
return FALSE;
To better explain what i want to do:
Get sidebar menu like on myspace for bands. When you land on bands page you can use sidebar menu to check their foto galleries, band members, video gallery and links must be made with a field that is not default username (it can be realname module or some other text field). Field validation is used so i do not get same name twice, and all links in pathauto are made example.com/bands/realname.
To repeat again it does work if realname contains 1 word.