Change an Extension's Labels
Most extensions allow you to change the labels of various fields as needed. To change these labels, you will need to add a line of TypoScript into your template.
For this How To, we'll be changing the username label of the Frontend User Registration extension. Let's first look at the current Frontend label.
Notice the current default label is Preferred username. We will change this to Preferred User Name.
To find the TypoScript label for the field you want, look at the HTML Source for the page. In Foxfire, the Firebug add-in is invaluable for getting this informati
- Begin by using the Extenstion Manager tool to open the extension you want to edit in order to gather the information you'll need to change the label.
- To view the local language file, click on the information dropdown menu and select Edit files.
Typically, the language files are in the subdirectory pi1 and are called locallang.xml. (Note, there are numerous exceptions, but almost always the file you're looking for is locallang.xml.)
- Scroll down and locate the locallang.xml file (there may be several ... look for the list of labels in the one you want).
Notice the preponderance of filenames with the tx_ extension. Make a note of this ... it will become a part of the TypoScript code.
- Next, click on the locallang.xml file to view it.
- In this case, we are changing the label username. Note that it is in the default index. Make a note of these two bits of information and then open either the page template where the extension plugin is loaded, or open the root template.
- Ensure the Info/Modify option is selected in the top dropdown menu, and then select Setup. Scroll to the bottom of the Setup form.
- First, add a Comment (preceded by the # symbol) to remind youself of the code addition. Then you'll add the TypoScript code to change the label.
- The TypoScript code looks like this:
plugin.EXT_FILENAME-DIRECTORY_p1._LOCAL_LANG.INDEX-NAME.LABEL = New Name
In our example, you would add the line ...
plugnin.tx_srfeuserregister_pi1._LOCAL_LANG.default.username = Preferred User Name
- Save the template when you're done and go to the Frontend to see the results of your work.
- Notice the change in the label. You can repeat this process for each label ... and often even the instructions for the extension.