1

我开发了一个大量使用 REST 数据源的扩展,并且在typo3 DB 中没有本地表。不,众所周知,这些网址并不是真正人类可读的。

所以我现在想做的是:

在我的根目录中,我有一个包含我的插件的页面,我希望有一个这样的 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 并看到了一些关于查找表等的内容。但是因为我没有本地查找表,所以我不能使用它。

希望的 url 结构通常可以实现吗?

有人可以尝试解释实现这一目标的最佳方法吗?

4

1 回答 1

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 规则。

于 2014-06-24T05:28:08.120 回答