DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: Extend the Constant Editor & settings of exts inside the EM

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2009-07-06T19:16:31.650000000
Classification:constantsextended
Keywords:constant editor, constants, extension manager settings
Author:Georg Ringer
Email:http://www.ringer.it
Info 4:
Language:en

img-1 img-2 EXT: Extend the Constant Editor & settings of exts inside the EM - constantsextended

EXT: Extend the Constant Editor & settings of exts inside the EM

Extension Key: constantsextended

Language: en

Keywords: constant editor, constants, extension manager settings

Copyright 2000-2008, Georg Ringer, <http://www.ringer.it>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.org

Table of Contents

EXT: Extend the t Editor & settings of exts inside the EM 1

`Introduction 3 <#1.1.Introduction|outline>`_

What does it do? 3

Screenshots 3

`Users manual 5 <#1.2.Users%20manual|outline>`_

`Configuration 6 <#1.3.Configuration|outline>`_

Adding the options to your extension 6

General settings 6

Option “Textarea” 6

Option “Page selector” 7

Option “Record list” 7

Option “Image” 7

Option “Iframe” 7

Option “HTML” 8

Other options 8

`You like the extension? 9 <#1.4.You%20like%20the%20extension_|outline>`_

`Known problems 10 <#1.5.Known%20problems|outline>`_

`To-Do list 11 <#1.6.To-Do%20list|outline>`_

`ChangeLog 12 <#1.7.ChangeLog|outline>`_

Introduction

What does it do?

This extension is for other extension developers only and doesn't produce any output! It allows other developers to have more available options inside the Constant Editor and the settings for extensions which can be done in the Extension Manager.

Current Available options are:

  • Textarea
  • Page selector,using the popup to select a page
  • A record selector, using any table you like displayed as select field
  • Plain image
  • Iframe
  • Plain HTML code

Screenshots

The screenshots should show an example how it can look like.

img-3

Image 1: Extended Constant Editor

img-4

Image 2: Extended settings in the Extension Manager

Users manual

Because this extension doesn't have an output, this chapter describes how you get the demo output inside your installation. Follow this steps:

Install the extension

Press the “Update” button to view the settings you can make inside the extension manager.

Go to your root page or any page where you have gotten a template record.

Include the static template “ DEMO Constants Extended ”.

Change to the “Constant Editor” and select “PLUGINS.CONSTANTSEXTENDED”.

This is everything!

Play around and if you find one of the new options useful, take a look at the next chapters to know how to icnlude those options into your own extensions!

Configuration

This chapter describes how you get the new options inside your own extension. This chapter won't describe how to create an extension!

Adding the options to your extension

There are 2 possible places for the options.

To the Constant Editor

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.

To the settings inside the Extension Manager

To add the options to the Extension Manager, you need to place the code inside the ext_conf_template.txt file.

You can find the demo file with the same name inside the root directory of the extension.

General settings

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
How to call it

To get to the new options, you need to add the following snippet to the 1 st 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.
Specific settings

Most of the new options can be configured by adding a snippet like this to the 1 st line.

settings=key1:value1,key2:value2,key3:value3

Read the next sections about the details

Option “Textarea”

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];
Options

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:

width

Key

width

Example for the value

300px

Description

Width of the textarea

height

Key

height

Example for the value

50px

Description

Height of the textarea

Important

Because of the postprocessing of the data it is not possible to save linebreaks! Therefore they are changed to '#####' before saving (by using JS) and back before showing them on the page! So you need to explode by '#####'.

Option “Page selector”

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];
Options
formName

Key

formName

Example for the value

tsStyleConfigForm

Description

Set the name of the form in which the page selector is used. If you are using this option inside the extension managers settings, set it to tsStyleConfigForm, otherwise it can be empty. Default is “editForm”

Option “Record list”

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];
Options

The only required option is the name of the table. All others are optional:

table

Key

table

Example for the value

pages, tt_content

Description

Table name

where

Key

where

Example for the value

Name!=””, ...

Description

Where clause

orderBy

Key

orderBy

Example for the value

Name desc, name asc, uid,...

Description

Order by

limit

Key

limit

Example for the value

2,10,100,1000,...

Description

Limit the result set

Option “Image”

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];
Options

Only one option and this is required.

file

Key

file

Example for the value

fileadmin/fo/abc.gif, typo3conf/ext/foobar/abc.gif

Description

Path to the image

Option “Iframe”

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];
Options

All options are the same as the attributes of the HTML object iframe (besides the https). No limitation.

src

Key

src

Example for the value

www.typo3.org , www.yourdomain.com/help.html

Description

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

Key

https

Example for the value

0 or 1

Description

If 1, the url will be prepended with https://, otherwise with http://

width

Key

width

Example for the value

200, 30,..

Description

Width of the iframe

height

Key

height

Example for the value

200, 300

Description

Height of the iframe

Option “HTML”

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];
Important

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#

;

Original character

;

Should be

#59#

,

Original character

,

Should be

#44#

Options

There is one option which is required

code

Key

code

Example for the value

<h1>Foo</h1>

Description

Your HTML code

Other options

If you need other things, write to me or much better: Do them yourself and send me a patch!

You like the extension?

I didn't have much work with this extension but it should be still honored. So if you like this extension, you can do one or more of the following things:

One of those things is the least you can do for getting all those great extensions completely for free!

Known problems

  • The extension needs at least TYPO3 4.2.0
  • There are no other problems I am aware of.

To-Do list

Nothing for now

ChangeLog

See the changelog file

12