Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:2.0:admidio_customization [2024/01/12 17:33] fasseen:2.0:admidio_customization [2024/01/12 21:31] (current) – [Use texts from language files] fasse
Line 56: Line 56:
 | {$additionalHeaderData} | <meta charset="utf-8">    | More html tags for the page header. | | {$additionalHeaderData} | <meta charset="utf-8">    | More html tags for the page header. |
 | {$content} | <html>...    | The actual content of the called page e.g. a dialog or a list. | | {$content} | <html>...    | The actual content of the called page e.g. a dialog or a list. |
-| {$currentUser} | Smith    | Object of the logged-in user. All information can be queried via this object, e.gthe last name {$currentUser->getValue('LAST_NAME')//(from version 4.3)//|+| {$currentUser} | Smith    | Object of the logged-in user. All profile data can be queried via this object. ([[en:2.0:admidio_customization#use_data_of_the_logged-in_user|Detailed documentation]]) //(from version 4.3)//|
 | {$debug} | false    | Normally //false// unless debug mode has been turned on in config.php | | {$debug} | false    | Normally //false// unless debug mode has been turned on in config.php |
 | {$hasPreviousUrl} | true    | Indicates whether there is a URL from which this page was called. In the default theme, a back button is then displayed. | | {$hasPreviousUrl} | true    | Indicates whether there is a URL from which this page was called. In the default theme, a back button is then displayed. |
Line 78: Line 78:
 | {$userUuid} | 97f8346c-ca53-40de-857a-459d26d9df40    | Uuid of the logged in user. **(obsolete, from version 4.3 please use {$currentUser->getValue('usr_uuid')})** | | {$userUuid} | 97f8346c-ca53-40de-857a-459d26d9df40    | Uuid of the logged in user. **(obsolete, from version 4.3 please use {$currentUser->getValue('usr_uuid')})** |
 | {$validLogin} | true    | With valid registration in Admidio //true//, otherwise //false//. | | {$validLogin} | true    | With valid registration in Admidio //true//, otherwise //false//. |
 +
 +==== Use data of the logged-in user ====
 +With Smarty you have access to all profile data and the UUID of the logged-in user in the template files. The ''currentUser'' object is available for this purpose, which you can integrate anywhere. For the profile data, you need the internal name of the profile field, which you can find in the settings of the respective profile field in Admidio. If you now want to display the first and last name of the user, for example, you can do this as follows:<code html>{$currentUser->getValue('FIRST_NAME')} {$currentUser->getValue('LAST_NAME')}</code> You can output the UUID with the following code:<code html>{$currentUser->getValue('usr_uuid')}</code> You can output the login name with this code:<code html>{$currentUser->getValue('usr_login_name')}</code> 
  
 ==== Use texts from language files ==== ==== Use texts from language files ====
-With Smarty you also have access to the texts from the language files (adm_program/languages) in the template files and can integrate them at any placeFor this purpose you need the individual abbreviation of the text e.g. SYS_FILE_EXTENSION_INVALID and you can integrate it into the html code using the following syntax:+With Smarty you also have access to the texts from the language files (adm_program/languages) in the template files and can integrate these at any pointThe ''l10n'' object is available for this purpose. All you need is the individual abbreviation of the texte.g. SYS_FILE_EXTENSION_INVALIDand you can then integrate this into the HTML code using the following syntax:
 <code html><b>{$l10n->get('SYS_FILE_EXTENSION_INVALID')}</b></code> <code html><b>{$l10n->get('SYS_FILE_EXTENSION_INVALID')}</b></code>
 The curly brackets with the l10n->get, as well as the normal brackets with the quotation marks must always be deposited. In between there is the text abbreviation, which is replaced by the text in the selected language when the page is displayed.  The curly brackets with the l10n->get, as well as the normal brackets with the quotation marks must always be deposited. In between there is the text abbreviation, which is replaced by the text in the selected language when the page is displayed. 
  • en/2.0/admidio_customization.1705077210.txt.gz
  • Last modified: 2024/01/12 17:33
  • by fasse