Login / Status
developer.Resource
Home . Documentation . Document Library . Tutorials
Sponsors
hosted by punkt.deTYPO3 and Open Source MagazineAOE Media

1.7. Creating records on pages

The pages table has a field, doktype, which is hardcoded in a relationship with the $PAGES_TYPES global var. The content of $PAGES_TYPES looks like this (in tables.php):

$PAGES_TYPES = Array(    "3" => Array(        "icon" => "pages_link.gif"    ),    "4" => Array(        "icon" => "pages_shortcut.gif"    ),    "5" => Array(        "icon" => "pages_notinmenu.gif"    ),    "6" => Array(            "type" => "web",        "icon" => "be_users_section.gif",        "allowedTables" => "*"    ),      // TypoScript: Limit is 200.       // When the doktype is 200 or above, the page WILL NOT be regarded as a "page" by TypoScript.       // Rather is it a system-type page    "199" => Array(                "type" => "sys",        "icon" => "spacer_icon.gif",    ),    "254" => Array(            "type" => "sys",        "icon" => "sysf.gif",        "allowedTables" => "*"    ),    "255" => Array(                "type" => "sys",        "icon" => "recycler.gif",        "allowedTables" => "*"    ),    "default" => Array(        "type" => "web",        "icon" => "pages.gif",        "allowedTables" => "pages,pages_language_overlay,tt_content,tt_links,tt_board,....  ",        "onlyAllowedTables" => "0"    ));

Each number in this array relates to the pages.doktype field value. This is the configuration of doktype:

        "doktype" => Array (            "exclude" => 1,                "label" => $LANG_GENERAL_LABELS["type"],            "config" => Array (                "type" => "select",                    "items" => Array (                        Array("Standard", "1"),                    Array("Advanced", "2"),                    Array("External URL", "3"),                    Array("Shortcut", "4"),                    Array("Not in menu", "5"),                    Array("Backend User Section", "6"),                    Array("-----", "--div--"),                    Array("Spacer", "199"),                    Array("SysFolder", "254"),                    Array("Recycler", "255")                ),                "default" => "1"            )        ),

... and it looks like this is the backend forms:

The $PAGES_TYPES array not only indicates which icons the page records should be assigned depending on their “doktype”. It also determines which tables are allowed be represented on the page! This is configured with the “allowedTables” list. This value may be a asterisk, *, in which case all records are allowed.

All records may apparently be created in sysFolders. This looks like this in the backend:

As you can see the Photo Marathon image records are allowed in sysFolders.

When we try to create records on a regular page, the list looks like this:

No Photo Marathon record in the list! Do'h!

However if we intend our newly configured table to be included in the list of records allowed on regular pages, we simply add it to the default list in the $PAGES_TYPES. This is done by adding this line to our extTables.php script:

$PAGES_TYPES["default"]["allowedTables"].=",user_photomarathon";

And in return we get to create the records: