1

我有一个如下所示的 URL:

http://domain.com/leistungen/industrial-design/?tx_fsproject_fsprojectfp%5Bproject%5D=2&tx_fsproject_fsprojectfp%5Baction%5D=show&tx_fsproject_fsprojectfp%5Bcontroller%5D=Project&cHash=7c405bcde49853af9a7e78bdf465002c

使用具有以下配置的 RealURL(以及此处解释的一些钩子函数):

'postVarSets' => array(
        '_DEFAULT' => array(
            // projects
            'industrial-design' => array(
                array(
                    'GETvar' => 'tx_fsproject_fsprojectfp[controller]',
                ),
                array(
                    'GETvar' => 'tx_fsproject_fsprojectfp[action]',
                ),
                array(
                    'GETvar' => 'tx_fsproject_fsprojectfp[project]',
                    'lookUpTable' => array(
                        'table' => 'tx_fsproject_domain_model_project',
                        'id_field' => 'uid',
                        'alias_field' => 'title',
                        'addWhereClause' => ' AND deleted !=1 AND hidden !=1',
                        'useUniqueCache' => 1,
                        'useUniqueCache_conf' => array(
                            'strtolower' => 1,
                            'spaceCharacter' => '-',
                        )
                    )
                ),
            ),
        ),
    ),

我得到一个如下所示的 URL:

http://domain.com/leistungen/industrial-design/industrial-design/projekt/project-b/

这还不错。但是,为什么这部industrial-design/分会出现两次?

4

1 回答 1

5

The first industrial-design is the page that is being displayed. The second one is the keyword inserted by RealURL to identify the set of variables. To avoid that you can:

  1. Change the structure of pages so that you don't have industrial-design page at all.
  2. Rename the postVarSets that you set up in the RealURL configuration.
  3. Use fixedPostVars instead as that doesn't use a keyword to identify the set of variables but a page UID.
于 2012-06-14T07:15:42.627 回答