[英]TYPO3 Real URL and TX_News, category link
我正在使用TYPO3 v.6.1 FLUID / EXTBASE。 我是足球教練,正在制作足球博客。 http://codem.dk/blog/我已經創建了一個類別鏈接列表,但是當我單擊一個鏈接時,它會刷新頁面並顯示所有新聞,而不僅僅是與該類別相關的新聞
我的類別鏈接是。
因此,如果我單擊類別鏈接“ Generelt”,那么我希望看到2條新聞,但全部顯示(7條新聞)。 當我將鏈接懸停時,我得到http://codem.dk/blog/newsCategoryConfiguration/generelt/,並且您可以看到它的工作原理,但是它顯示的是所有新聞,而不僅僅是類別中的2條新聞。
有人可以指導我解決此問題嗎?
我在/ public_html / typo3conf / ext / news代碼中的ext_localconf.php看起來像這樣。
<?php
if (!defined ('TYPO3_MODE')) {
die ('Access denied.');
}
// Extension manager configuration
require_once(t3lib_extMgm::extPath('news') . 'Classes/Utility/EmConfiguration.php');
$configuration = Tx_News_Utility_EmConfiguration::getSettings();
Tx_Extbase_Utility_Extension::configurePlugin(
$_EXTKEY,
'Pi1',
array(
'News' => 'list,detail,dateMenu,searchForm,searchResult',
'Category' => 'list',
'Tag' => 'list',
),
array(
'News' => 'searchForm,searchResult',
)
);
// Page module hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info'][$_EXTKEY . '_pi1'][$_EXTKEY] =
'EXT:' . $_EXTKEY . '/Classes/Hooks/CmsLayout.php:Tx_News_Hooks_CmsLayout->getExtensionSummary';
// Preview of news records
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][$_EXTKEY] =
'EXT:' . $_EXTKEY . '/Classes/Hooks/Tcemain.php:Tx_News_Hooks_Tcemain';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'][$_EXTKEY] =
'EXT:' . $_EXTKEY . '/Classes/Cache/ClassCacheBuilder.php:Tx_News_Cache_ClassCacheBuilder->build';
// Tceforms: Rendering of fields
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass'][$_EXTKEY] =
'EXT:' . $_EXTKEY . '/Classes/Hooks/Tceforms.php:Tx_News_Hooks_Tceforms';
// Modify flexform values
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['getFlexFormDSClass'][$_EXTKEY] =
'EXT:' . $_EXTKEY . '/Classes/Hooks/T3libBefunc.php:Tx_News_Hooks_T3libBefunc';
/* ===========================================================================
Custom cache, done with the caching framework
=========================================================================== */
$cachingTableName = 'news_categorycache';
if (!is_array($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations'][$cachingTableName])) {
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations'][$cachingTableName] = array();
}
// Define string frontend as default frontend, this must be set with TYPO3 4.5 and below
// and overrides the default variable frontend of 4.6
if (!isset($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations'][$cachingTableName]['frontend'])) {
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations'][$cachingTableName]['frontend'] = 't3lib_cache_frontend_StringFrontend';
}
if (Tx_News_Utility_Compatibility::convertVersionNumberToInteger(TYPO3_version) < '4006000') {
// Define database backend as backend for 4.5 and below (default in 4.6)
if (!isset($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations'][$cachingTableName]['backend'])) {
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations'][$cachingTableName]['backend'] = 't3lib_cache_backend_DbBackend';
}
// Define data and tags table for 4.5 and below (obsolete in 4.6)
if (!isset($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations'][$cachingTableName]['options'])) {
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations'][$cachingTableName]['options'] = array();
}
if (!isset($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations'][$cachingTableName]['options']['cacheTable'])) {
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations'][$cachingTableName]['options']['cacheTable'] = 'cf_news_categorycache';
}
if (!isset($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations'][$cachingTableName]['options']['tagsTable'])) {
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations'][$cachingTableName]['options']['tagsTable'] = 'cf_news_categorycache';
}
}
// Class cache
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['class_cache'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['class_cache'] = array(
'backend' => 't3lib_cache_backend_FileBackend',
'frontend' => 't3lib_cache_frontend_PhpFrontend',
);
}
/* ===========================================================================
Add soft reference parser
=========================================================================== */
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser']['news_externalurl'] = 'EXT:' . $_EXTKEY . '/Classes/Database/SoftReferenceIndex.php:&Tx_News_Database_SoftReferenceIndex';
/* ===========================================================================
Add TSconfig
=========================================================================== */
// For linkvalidator
if (t3lib_extMgm::isLoaded('linkvalidator')) {
t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/Configuration/TSconfig/Page/mod.linkvalidator.txt">');
}
/* ===========================================================================
Real URL setup
=========================================================================== */
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']['postVarSets']['_DEFAULT']['action'] = array(
array(
'GETvar' => 'tx_news_pi1[controller]',
),
array(
'GETvar' => 'tx_news_pi1[action]',
),
);
/* Normale Newslink setup */
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']['postVarSets']['_DEFAULT']['news'] = array(
array(
'GETvar' => 'tx_news_pi1[news]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_news',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => 'AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
'enable404forInvalidAlias' => '1',
),
)
);
/* Category setup */
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']['postVarSets']['_DEFAULT']['newsCategoryConfiguration'] = array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_category',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
'enable404forInvalidAlias' => '1',
),
)
);
/* TAGS setup */
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']['postVarSets']['_DEFAULT']['newsTagConfiguration'] = array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_tag',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
'enable404forInvalidAlias' => '1',
),
)
);
?>
我的猜測是您根本沒有設置tt_news的“ 類別模式 ”。 在插件中將其設置為“ 顯示已分配了至少一個選定類別的新聞(或) ”(實際上沒有選擇任何類別),或者在TypoScript中將其設置為:
plugin.tt_news.categoryMode = 1
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.