2013-11-26 124 views
1

我有一個TYPO3擴展新聞系統和實際URL的小問題。TYPO3新聞系統和RealURL

它不顯示的URL像

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

但顯示像

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

我在realurl文件添加插件代碼,所以我不知道什麼是錯的,和所有其他沒有鏈接到新聞的鏈接工作正常。

在擴展管理器的真正網址我有這樣的路徑配置文件: typo3conf/realurl.php

有人能看到,這裏有什麼錯?

我用FLUID/EXTBASE運行TYPO3 v 6.1。

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設置) enter image description here

+0

是在RealURL自動配置關閉? – lorenz

+0

是的,它不是在EM中「啓用」,請參閱主要問題中的添加圖像。 –

回答

1

我相信你必須編輯這個文件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中。

注意:請記住在更改並保存文件後清除緩存。

+0

嗨,Hennett,現在幾乎在工作,THX ;-),但它使用newsID作爲http://codem.dk/blog/artikel/news/5/而不是http://codem.dk/blog/artikel/news/usunde_energidrikke /我在哪裏改變它? –

+0

它必須對** id_field **和/或** alias_field **進行一些操作。我不確定你必須改變哪個值,或者如果你必須改變這兩者。看看這裏[http://wiki.typo3.org/Realurl/manual](http://wiki.typo3.org/Realurl/manual)並搜索這個__-> lookUpTable__。那裏的定義表可能會給你一個提示。 – barcasal

+0

嗨,Hennett,你會找到。添加一個答案。和THX –

0

要獲得您的鏈接,而不是UID(codem.dk/blog/artikel/news/5)稱號,更改以下:

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