【问题标题】:Extbase: configure controller and action in realURL for detailExtbase:在 realURL 中配置控制器和操作以获取详细信息
【发布时间】:2015-03-06 22:20:00
【问题描述】:

realURL 和 extbase 我快疯了。

列表/详细信息扩展是否有一个简单的解决方案来显示至少有序的 URL,可能是

/show/detail/title-of-the-item

“show”和“detail”是动作和控制器,例如

我一直在尝试删除控制器和操作,例如 RealURL: Remove Controller and Action from URL 中的建议 - 但总是有一些东西不起作用。疯狂的。 它甚至没有删除 cHash。

我现在的realurl_conf是:

<?php

$TYPO3_CONF_VARS['EXTCONF'] ['realurl'] ['_DEFAULT'] = getRealURL('1');


function getRealURL($root)
{
    return array(
        'init' => array(
            'appendMissingSlash' => 'ifNotFile',
            'enableUrlDecodeCache' => 1,
            'enableCHashCache' => 1,
            'enableUrlEncodeCache' => 1,
            'respectSimulateStaticURLs' => 0,
           'postVarSet_failureMode'=>'redirect_goodUpperDir',

        ),
    'redirects_regex' => array (

    ),
    'preVars' => array(
                        array(
                             'GETvar' => 'L',
                             'valueMap' => array(
                                                'de' => '0',
                                                'fr' => '1',
                                        ),
                             'valueDefault' => 'de',
                             'noMatch' => 'bypass',
                        ),
                      array(
                                'GETvar' => 'no_cache',
                                'valueMap' => array(
                                    'no_cache' => 1,
                                ),
                                'noMatch' => 'bypass',
                        ),
                ),
     'pagePath' => array(
            'type' => 'user',
            'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
            'spaceCharacter' => '-',
            'languageGetVar' => 'L',
            'expireDays' => 7,
            'rootpage_id' => 1,
        ),


         'postVarSets' => array(
            '_DEFAULT' => array(
                'wb' => array(
                    array(
                        'GETvar' => 'tx_weiterbildung_pi1[item]' ,
                        'lookUpTable' => array(
                            'table' => 'tx_weiterbildung_domain_model_item',
                            'id_field' => 'uid',
                            'alias_field' => 'kurs_titel',
                            'addWhereClause' => ' AND NOT deleted',
                            'useUniqueCache' => 1,
                            'useUniqueCache_conf' => array(
                                'strtolower' => 1,
                                'spaceCharacter' => '-',
                            ),
                        ),
                    ),
                ),
            ),
        ),

      'fileName' => array(
            'defaultToHTMLsuffixOnPrev'=>0,
            'index' => array(
                'rss.xml' => array(
                    'keyValues' => array(
                        'type' => 100,
                    ),
                ),
                'rss091.xml' => array(
                    'keyValues' => array(
                        'type' => 101,
                    ),
                ),
                'rdf.xml' => array(
                    'keyValues' => array(
                        'type' => 102,
                    ),
                ),
                'atom.xml' => array(
                    'keyValues' => array(
                        'type' => 103,
                    ),
                ),
            ),
        ),
 );
}
/**********************************
REALURL end
***********************************/
?>

【问题讨论】:

    标签: typo3 extbase typo3-6.2.x realurl


    【解决方案1】:

    不是很简单,但至少可以工作......

    在我的每一个分机中,我都不使用f:link.action VH,而是使用f:link.page,这样你就可以像这样生成链接

    ?id=123&tx_yourext_foo=bar
    

    如果没有控制器和动作参数,当然正如您所看到的,您很可能需要修改您的 FE 插件,以使用 GeneralUtility::_GP('tx_yourext_foo') 读取这些参数,特别是如果此插件使用的模式(动作)不止取决于参数

    【讨论】:

    • 你可能是对的!我只是累了。我将在stackoverflow.com/questions/26142614/… 上发布一个我正在使用的控制器类,也许你可以说一下区别
    • 这不是问题的答案。你是在避免问题而不是解决它。事实上,他没有在配置中包含控制器和操作。这意味着他根本不碰他们。据我所知,您通常可以包含 GETvar 控制器和操作。你现在至少绕过了控制器,剩下 postVarSet 键、操作和项目名称。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-29
    • 2014-07-24
    • 2015-05-23
    • 2022-07-13
    • 1970-01-01
    相关资源
    最近更新 更多