TYPO3新闻系统和RealURL(TYPO3 news system and RealURL)

2019-09-28 19:04发布

我与TYPO3扩展新闻系统和实时URL一个小问题。

它没有显示类似的网址

http://codem.dk/blog/artikel/usunde_energidrikke

但显示它像

http://codem.dk/blog/artikel/?tx_news_pi1[news]=5&cHash=5370a02c0dc7e653fede425de7ac9187

我已经加入我的realurl文件的插件代码,所以我不知道什么是错的,这是不链接到新闻的所有其他链接工作正常。

在扩展管理器的真正网址我有这样的路径配置文件: typo3conf/realurl.php

有人可以看到,这里有什么错?

进出口运行TYPO3诉6.1流体/ EXTBASE。

realurl.php文件看起来是这样的:

<?php

$TYPO3_CONF_VARS['FE']['addRootLineFields'].= ',tx_realurl_pathsegment';
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
        'pagePath' => array(
                'type' => 'user',
                'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
                'spaceCharacter' => '-',
                'languageGetVar' => 'L',
                'expireDays' => '3',
                'rootpage_id' => 1,
                'firstHitPathCache'=>1
        ),
        'init' => array(
                'enableCHashCache' => TRUE,
                'enableCHashCache' => 1,
                'respectSimulateStaticURLs' => 0,
                'enableUrlDecodeCache' => 1,
                'enableUrlEncodeCache' => 1
        ),
        'preVars' => array(
                array(
                        'GETvar' => 'L',
                        'valueMap' => array(
                                'en' => '1',
                        ),
                        'noMatch' => 'bypass',
                ),
                array(
                        'GETvar' => 'no_cache',
                        'valueMap' => array(
                                'nc' => 1,
                        ),
                        'noMatch' => 'bypass',
                ),
        ),
        'fixedPostVars' => array(
                'newsDetailConfiguration' => 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' => '-'
                                        ),
                                        'languageGetVar' => 'L',
                                        'languageExceptionUids' => '',
                                        'languageField' => 'sys_language_uid',
                                        'transOrigPointerField' => 'l10n_parent',
                                        'autoUpdate' => 1,
                                        'expireDays' => 180,
                                )
                        )
                ),
                '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' => '-'
                                        )
                                )
                        )
                ),
                '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' => '-'
                                        )
                                )
                        )
                ),
                '52' => 'newsDetailConfiguration',
                '701' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
                '71' => 'newsTagConfiguration',
                '72' => 'newsCategoryConfiguration',

        ),
        'postVarSets' => array(
                '_DEFAULT' => array(
                        'controller' => array(
                                array(
                                        'GETvar' => 'tx_news_pi1[action]',
                                        'noMatch' => 'bypass'
                                ),
                                array(
                                        'GETvar' => 'tx_news_pi1[controller]',
                                        'noMatch' => 'bypass'
                                )
                        ),

                        'dateFilter' => array(
                                array(
                                        'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
                                ),
                                array(
                                        'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
                                ),
                        ),
                        'page' => array(
                                array(
                                        'GETvar' => 'tx_news_pi1[@widget_0][currentPage]',
                                ),
                        ),
                ),
        ),

);

?>

(在扩展管理器实时URL设置)

Answer 1:

我相信你有才能有真正的URL来编辑文件ext_localconf.php。 您可以编辑该文件,并添加以下代码,并告诉我结果如何?

$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']['postVarSets']['_DEFAULT']['action'] = array(
    array(
       'GETvar' => 'tx_news_pi1[controller]',
    ),
    array(
       'GETvar' => 'tx_news_pi1[action]',
    ),
);

$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' => 'title',
            'alias_field' => 'name',
            'addWhereClause' => 'AND NOT deleted',
            'useUniqueCache' => 1,
            'useUniqueCache_conf' => array(
                'strtolower' => 1,
                'spaceCharacter' => '-',
             ),
             'enable404forInvalidAlias' => '1',
        ),
    )
);

该文件位于root_folder/typo3conf/ext/news

注意 :请记住清除您更改并保存文件后立即高速缓存。



Answer 2:

为了让你的链接,而不是UID(codem.dk/blog/artikel/news/5)标题,改变如下:

        'table' => 'tx_news_domain_model_news',
        'id_field' => 'uid',
        'alias_field' => 'title',


文章来源: TYPO3 news system and RealURL