Forum Discussion

micha80's avatar
micha80
Expert
10 years ago

Text key with user information

Hello,

 

I want to overwrite a default text key with a new value which includes a user name. This is the text key I want to modify:

 

profile.module.contact.title = Mich kontaktieren

 

And it should be something like:

 

profile.module.contact.title = ${profile.login} kontaktieren

 

This text key is used on the profile page:  https://community/t5/user/viewprofilepage/user-id/XXX

 

And the "${profile.login}" variable should be the login name from the user of the profile page the visitor is actually looking at.

 

Is there any option to get the profile name in a text key?

 

Thanks a lot,

Michael

  • micha80 

     

    You can definitely pass variables to your text keys in custom components. See an example here . You won't be able to do that in a standard component unless the existing key already expects a placeholder.

     

    Hope this helps,

     

3 Replies

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)
    10 years ago

    micha80 

     

    You can definitely pass variables to your text keys in custom components. See an example here . You won't be able to do that in a standard component unless the existing key already expects a placeholder.

     

    Hope this helps,

     

  • micha80's avatar
    micha80
    Expert
    10 years ago
    Hi PaoloT,

    thanks for the answer. So in my situation it is not possible cause I want to overwrite a core component.

    Regards,
    Michael
  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)
    10 years ago
    Exactly, for a core component that would work only if the component itself was already supporting that behavior (otherwise no data will be passed to the placeholder in the text key for the substitution)