🌍
English
This shows you the differences between two versions of the page.
user_documentation:learn:customize:use_first_last_names [2014/01/23 15:06] flop25 created |
user_documentation:learn:customize:use_first_last_names [2014/01/23 15:11] (current) flop25 |
||
---|---|---|---|
Line 5: | Line 5: | ||
Creating a custom log-in page is much better for the user in case of private galleries ( $conf['guest_access'] = false; see [[user_documentation:use:features:conf_locale]] ), so I recommend merging the register.tpl template in the identification.tpl as a complementary | Creating a custom log-in page is much better for the user in case of private galleries ( $conf['guest_access'] = false; see [[user_documentation:use:features:conf_locale]] ), so I recommend merging the register.tpl template in the identification.tpl as a complementary | ||
- | First change the registration template and log-in template: read [[user_documentation:use:features:template]] and so work on register.tpl and identification.tpl | + | First change the registration template and log-in template: read [[user_documentation:use:features:template]] and so work on register.tpl and identification.tpl\\ |
- | Here the goal is to duplicate the html code for the username, and adapt to last and first names | + | Here, the goal is to duplicate the html code for the username, and adapt it to last and first names |
- | for themes based on 'default', you have in register.tpl | + | for themes based on 'default'\\ |
+ | So you have inside register.tpl: | ||
<code html> | <code html> | ||
<li> | <li> | ||
Line 32: | Line 33: | ||
</code> | </code> | ||
- | Here the words 'Lastname' and 'Firstname' are NOT translated: to translate them use {'Lastname'|@translate} instead and then you will have to add your own translations, still using the plugin Local Files Editor and its tab 'Languages' | + | <wrap info>__ __ :</wrap>Here the words 'Lastname' and 'Firstname' are NOT translated: to translate them use {'Lastname'|@translate} instead and then you will have to add your own translations, still using the plugin Local Files Editor and its tab 'Languages' |
Do the same in identification.tpl on | Do the same in identification.tpl on | ||
Line 76: | Line 77: | ||
} | } | ||
</code> | </code> | ||
- | it will: | + | it will:\\ |
- | - intercept the first and last send when registring or logging-in, in order to build an username which will be 'Firstname Lastname': ucwords+strtolower is to get the first letter in capital and the rest in lower case | + | - intercept the first and last send when registring or logging-in, in order to build an username which will be 'Firstname Lastname': ucwords+strtolower is to get the first letter in capital and the rest in lower case.\\ |
- assign 'F_LASTNAME' and 'F_FIRSTNAME' with the values sended, for display. It's when the user is registrering but something is wrong, so the user don't have to type again. | - assign 'F_LASTNAME' and 'F_FIRSTNAME' with the values sended, for display. It's when the user is registrering but something is wrong, so the user don't have to type again. | ||
"$template->assign(array( 'F_KEY' => get_ephemeral_key(6) ));" is only needed when you want to merge register.tpl in identification.tpl | "$template->assign(array( 'F_KEY' => get_ephemeral_key(6) ));" is only needed when you want to merge register.tpl in identification.tpl |