TYPO3新闻系统和RealURL [英] TYPO3 news system and RealURL

查看:93
本文介绍了TYPO3新闻系统和RealURL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的TYPO3扩展新闻系统和真实URL有点问题.

I have a little problem with the TYPO3 extension News System and Real URL.

它没有显示类似的网址

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

但显示得像

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

我已经在我的realurl文件中添加了插件代码,所以我不知道出了什么问题,并且所有其他未链接到新闻的链接都可以正常工作.

I have added the plugin code in my realurl file, so i don't know what's wrong, and all other links which are not linking to a news are working fine.

在Real Url扩展管理器中,我具有以下配置文件路径: typo3conf/realurl.php

In the Extension Manager for Real Url I have this path to the configuration file: typo3conf/realurl.php

有人可以看到,这是怎么回事吗?

Can someone see, what's wrong here?

我正在使用FLUID/EXTBASE运行TYPO3 v.6.1.

Im running TYPO3 v. 6.1 with FLUID/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]',
                                ),
                        ),
                ),
        ),

);

?>

(扩展管理器中的Real URL设置)

(Real URL Setup in Extension-manager)

推荐答案

我相信您必须编辑文件 ext_localconf.php 才能获得真实的网址.您可以编辑文件并添加此代码并告诉我结果吗?

I believe you have to edit the file ext_localconf.php in order to have real urls. Can you edit the file and add this code and tell me the results?

$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中.

注意:切记在更改并保存文件后立即清除缓存.

Note: Remember to clear cache right after you change and save the file.

这篇关于TYPO3新闻系统和RealURL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆