【问题标题】:TYPO3 - Extbase SEO UrlsTYPO3 - Extbase SEO 网址
【发布时间】:2014-06-23 16:06:46
【问题描述】:

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

所以我现在想做的是:

在我的根目录中,我有一个包含我的插件的页面,我希望有一个这样的 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 结构通常可以实现吗?

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

【问题讨论】:

    标签: typo3 extbase typo3-6.1.x realurl


    【解决方案1】:

    您不仅可以使用自己的查找表,还可以使用用户定义的函数:

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

    【讨论】:

    • 好的。感谢那。那会怎么看网址呢? www.example.com/yourParameterIdentifier 如果我想让这部分 [yourParameterIdentifier] 动态“yourParamIdentifier”可以吗?也许有一些通配符?
    • 数组的最后两行隐藏了这个路径段,所以你可以为你的控制器和动作选择你自己的路径段。
    • 我认为您将不得不忍受 www.example.com/products/category-title-1/seo-friendly-product-name 之类的东西,(productsyourParamIdentifier) - 这是正确的,@sreuter,不是吗?
    • 不,你可以在123 => 'yourParamIdentifier'的路径中省略这个参数。这意味着在第 123 页上,此参数在后台隐式设置。
    猜你喜欢
    • 2012-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-02
    • 2013-08-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多