typeNum
Pages are referenced by two main values. The “id” and “type”.
The “id” points to the uid of the page (or the alias). Thus the page is found.
The “type” is used to define how the page should be rendered. This is primarily used with framesets. Here the frameset normally has the type=0 (or not set) and the documents in the frameset would be defined with another type, eg. type=1 for the content-page.
You should explore the framesets of the TYPO3-sites around. Also look in the standard-templates for framesets.
It’s a good habit to use type=1 for the main-page of a website with frames. With no-frames sites type is normally zero.
Another good habit is to use “page” as the toplevel-objectname for the content-page on a website.
example:
## This enables the xml news feed
xmlnews = PAGE
xmlnews {
typeNum = 100
10 < plugin.tt_news
10.pid_list >
10.pid_list = 60,73
10.singlePid = 64
10.defaultCode = XML
10.catTextMode = 1
10.catImageMode = 0
config {
index_enable = 0
no_cache = 1
disableAllHeaderCode = 1
additionalHeaders = Content-type:application/xml
xhtml_cleaning = 0
admPanel = 0
}
}
TTNEWS:
config.domain = demo.net
###
# These are the default TS-constants for RSS feeds from tt_news
##
plugin.tt_news {
displayXML {
xmlFormat = rss2
xmlTitle = demo.de: Latest News
xmlLink = http://demo.net/
xmlDesc = Latest news from demo.de
xmlLang = en
xmlIcon = EXT:tt_news/ext_icon.gif
xmlLimit = 10
xmlCaching = 1
rss2_tmplFile = EXT:tt_news/res/rss_2.tmpl
rss091_tmplFile = EXT:tt_news/res/rss_0_91.tmpl
rdf_tmplFile = EXT:tt_news/res/rdf.tmpl
atom03_tmplFile = EXT:tt_news/res/atom_0_3.tmpl
atom1_tmplFile = EXT:tt_news/res/atom_1_0.tmpl
}
}
eID:
config: $TYPO3_CONF_VARS[‘FE’][‘eID_include’][‘example’] = ‘EXT:example/fe_index.php’;
how to get: ?eID=example
if you want to use sys function:
tslib_eidtools::connectDB();
高级扩展:
<?PHP
header('Content-Type: text/html; charset=UTF-8');
// Exit, if script is called directly (must be included via eID in index_ts.php)
if (!defined ('PATH_typo3conf')) die ('Could not access this script directly!');
require_once(PATH_tslib.'class.tslib_pibase.php');
/* Fake class LL support */
class csConvObj {
function parse_charset() {
return 'utf-8';
}
function utf8_decode($l,$c) {
return $l;
}
}
$TSFE = new stdClass;
$TSFE->csConvObj = new csConvObj;
class DEIN KLASSEN NAME extends tslib_pibase {
function main() {
global $TSFE;
$feUserObj = tslib_eidtools::initFeUser(); // Initialize FE user object,
tslib_eidtools::connectDB(); //Connect to database
// Sprache aus GET-Variable auslesen
// Wenn Variable fehlt, dann Fallback auf 'default'
$this->lang = t3lib_div::_GET('lang');
if($this->lang == '') $this->lang = 'default';
// locallang.xml parsen
$LOCAL_LANG = t3lib_div::readLLfile('EXT:DEIN EXTENSION NAME/pi1/locallang.xml',$this->lang);
$LOCAL_LANG[$this->lang]['DEIN LABEL']
}
$output = t3lib_div::makeInstance('DEIN KLASSEN NAME');
$output->main();
?>
Static Public Member Functions |
|
static | initFeUser () |
static | connectDB () |
static | initLanguage ($language= ‘default’) |
static | initTCA () |
static | initExtensionTCA ($extensionKey) |