0

I'm new to joomla development, but I can't seem to figure out how to dynamically fetch descriptions to be displayed as tool tips for the form data of a module backend. I'm looking at an example module from joomlart and their code for a single field element in their xml file looks like this.

<field 

                name="mainWidth" 

                type="text" 

                default="auto"

                size="5"

                label="MAIN_WIDTH" 

                description="MAIN_WIDTH_DESC" />

MAIN_WIDTH and MAIN_WIDTH_DESC are obviously variables that are somehow being accessed and rendered later when the module is run in the backend but I can't find where the values to these variables are stored or how to replicate this behavior. Any help would be appreciated.

1 Answers1

0

Label is the label that prints to screen, and description is rendered as the tooltip.

You can just replace these variable names with the actual text and it will work when the form is rendered. However, in your example, I believe they are using language files to get the text to display.

Whilst you can set a language file within your module for that module's use, naming convention suggests to me that these are being pulled from somewhere like the template's language file.

( Such a file is likely to be found either under /language or /administrator/language or /templates/yourtemplate/language )

The benefit of such files is to allow for translations of the site to exist without having to write a new module / template each time.

Ultimately, if you don't want various language versions of your site, and you only intend to use the module on one site and not sell it as an extension, then there is no strong need to create a language file for your own bespoke modules (though best practise would probably be to do so).

RichardB
  • 2,615
  • 1
  • 11
  • 14
  • Sounds great, thanks. I was just using the text in the desc tag instead of the variables but I wasn't sure the advantage of the variables. Now I know. Appreciate it. – atinybeardedman Jul 02 '14 at 14:20