TYPO3 Real URL和TX_News,类别链接

时间:2013-11-28 14:24:28

标签: typo3 typo3-6.1.x

我在TYPO3 v.6.1 FLUID / EXTBASE工作。我是一名足球教练,正在制作足球博客。 http://codem.dk/blog/ 我已经制作了一个类别链接列表,但是当我点击链接时,它会刷新页面并显示所有新闻,而不仅仅是与该类别相关的新闻

我的类别链接是。

  • 动议(0新闻)
  • Skader&恢复原状(2条新闻)
  • Ernæring(1条新闻)
  • Opskrifter(2条新闻)
  • Generelt(2条新闻)

因此,如果我点击类别链接“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',
        ),
    )
);  
?>

1 个答案:

答案 0 :(得分:0)

我的猜测是你没有设置tt_news的“类别模式”。在插件中将其设置为“显示至少有一个所选类别已分配(或)”的新闻(不实际选择任何类别)或在TypoScript中:

plugin.tt_news.categoryMode = 1