2014-06-23 76 views
1

我開發了大量使用REST數據源的擴展,並且我在typo3 DB中沒有本地表。不,據瞭解,這些網址並不是人類可讀的。TYPO3 - Extbase SEO Url

所以我現在想要做的是這樣的:

在我rootline我有一個網頁,其中包括我的插件,我想有一個URL結構是這樣的:

www.example.com/category-title-1/seo-friendly-poduct-name.html 

一些解釋不同的URL部分:

[category-title-1] => This is a dynamic part from the Webservice and i don't know them in advance 
[seo-friendly-poduct-name] => This comes from the Webservice to. 
[.html] => filename ending 

我已經讀了很多RealUrl,看到一些關於查找表等。 但是,因爲我有noch本地查找表,我不能使用它。

是否希望的網址結構一般可以實現?

有人可以嘗試解釋什麼是實現這一目標的最佳方法?

回答

2

您不僅可以使用自己的對照表,而且用戶自定義函數:

... 
'fixedPostVars' => array(
    // your extension parameter identifier 
    'yourParamIdentifier' => array(
     array(
      'GETvar' => 'tx_yourextension_plugin[parameter]', 
      'userFunc' => 'EXT:yourextension/pi1/class.tx_yourextension_realurl.php:&tx_yourextension_realurl->handleRealURLCoding', 
     ) 
    ), 
    // set the page id with your plugin to paramater identifier to hide the page segment from url 
    123 => 'yourParamIdentifier', 
), 
... 

在該方法中handleRealURLCoding可以處理自己的realurl規則,而無需任何表。

+0

好的。感謝那。那麼怎麼看網址呢? www.example.com/yourParameterIdentifier以及如果我想讓這部分[yourParameterIdentifier]動態的「yourParamIdentifier」可能會怎樣?也許有一些通配符? – MadeOfSport

+0

陣列中的最後兩行隱藏此路徑段,以便您可以爲控制器和操作選擇自己的路徑段。 –

+0

我想你將不得不像「www.example.com/products/category-title-1/seo-friendly-product-name」那樣生活,(產品是'yourParamIdentifier') - 這是正確的,@sreuter ,不是嗎? – Urs