This chapter describes how you get the new options inside your own extension. This chapter won't describe how to create an extension!
There are 2 possible places for the options.
To add the options to the Constant Editor you either add the code to the ext_typoscript_constants.txt file in the root directory of your EXT or you use the static TS file.
You can find the demo file inside the directory static.
All new options are configured in nearly the same way.
A typical input field would look like
# cat=basic;type=int[0-800]; label=With of something: Set the width of something
width = 470
To get to the new options, you need to add the following snippet to the 1st line:
type=user[EXT:constantsextended/class.tx_constantsextended.php:&tx_constantsextended->XXXXXX];
It doesn't matter at which position but important is that every section ends with a ;
XXXXXX needs to be replaced with the correct name of the option. Please take a look at the next sections to get to know more about it.
The textarea allows you to save multiple lines instead of the boring input option.
It is called by using:
type=user[EXT:constantsextended/class.tx_constantsextended.php:&tx_constantsextended->textarea];
All options are optional and can be used to style the textarea with any css code you know (and which works with textareas). Those are just examples:
Key: | Example for the value | Description: |
|---|---|---|
width | 300px | Width of the textarea |
height | 50px | Height of the textarea |
Be able to let the users select a page from the page tree instead of typing the ID of the page into an input field.
It is called by using:
type=user[EXT:constantsextended/class.tx_constantsextended.php:&tx_constantsextended->page];
Be able to render any resultset of a table as a select field to let the user pick a specific record.
It is called by using:
type=user[EXT:constantsextended/class.tx_constantsextended.php:&tx_constantsextended->recordList];
This option is mainly interesting inside the extension managers settings to display an image which can help the user with his decisions.
It is called by using:
type=user[EXT:constantsextended/class.tx_constantsextended.php:&tx_constantsextended->image];
Like the image you can use this option to include a help page which could be a normal frontend page or a static HTML page from somewhere else or whatever you want to have.
It is called by using:
type=user[EXT:constantsextended/class.tx_constantsextended.php:&tx_constantsextended->iframe];
All options are the same as the attributes of the HTML object iframe (besides the https). No limitation.
Key: | Example for the value | Description: |
|---|---|---|
src | www.typo3.org, www.yourdomain.com/help.html | Don't use the http:// there and start with the www. or withozt it. If you need https, take a look at the next line |
https | 0 or 1 | If 1, the url will be prepended with https://, otherwise with http:// |
width | 200, 30,.. | Width of the iframe |
height | 200, 300 | Height of the iframe |
Use this option to display plain HTML code to do whatever you want.
It is called by using:
type=user[EXT:constantsextended/class.tx_constantsextended.php:&tx_constantsextended->html];
You need to be aware that you can't use any of the following characters: : , ;
If you still need those, for example to set a class or whatever, you need to replace them first with something else. It will be replaced to the original character before output.
Original character: | Should be |
|---|---|
: | #58# |
; | #59# |
, | #44# |