首页 文章

TYPO3更新到8.7模板不起作用

提问于
浏览
0

我尝试将Typo3安装从6.1更新到8.7 LTS,但我没有让模板工作 . 到目前为止我做了什么:

  • 将核心更新为6.2 - > 7.6 - > 8.7

  • 尽可能更新了所有扩展程序

旧安装使用了Fluid Pages Engine,但这不适用于8.7 . 据我所知,流体现在包含在错字3中?

后端工作到目前为止 . 我可以管理用户,页面和我看到的一切 . 但是,当我打电话给前端时,我得到一个例外:

#1294587217: The page is not configured! [type=0][]. This means that there is no TypoScript object of type PAGE with typeNum=0 configured. 

TYPO3\CMS\Core\Error\Http\ServiceUnavailableException thrown in file
...\typo3_src-8.7.10\typo3\sysext\frontend\Classes\Controller\TypoScriptFrontendController.php    in line 2487.

我尝试了wikipage的解决方案并替换了“setup”-Template信息

<INCLUDE_TYPOSCRIPT: source="FILE:fileadmin/typoscript/domain.ts">
<INCLUDE_TYPOSCRIPT: source="FILE:fileadmin/typoscript/typoscript.ts">
page.stdWrap.parseFunc.short.i3 = <span style="text-transform:normal;">i3</span>

# Default PAGE object:
page = PAGE
# Define output for typeNum=0, the default type.
page.typeNum = 0
page.10 = TEXT
page.10.value = HELLO WORLD!

然后我看到“你好世界!” . 现在我陷入了困境:我需要做些什么来让“正常”模板工作?

提前致谢

2 回答

  • 1

    TYPO3 7和8都包含FLUIDTEMPLATE Typoscript对象,但EXT:fluidpages是由fluidtypo3.org团队保留的外部扩展 .

    正如你写的:

    # Default PAGE object:
    page = PAGE
    # Define output for typeNum=0, the default type.
    page.typeNum = 0
    page.10 = TEXT
    page.10.value = HELLO WORLD!
    

    您正在定义PAGE对象将仅包含该simpe TEXT对象 .

    使用FLUIDTEMPLATE对象的“最小”配置是:

    page = PAGE
    page.typeNum = 0
    page.10 = FLUIDTEMPLATE
    page.10{      
      templateName = Default
    
      layoutRootPaths {
          0 = Path/To/Your/Layouts/  
      }
      partialRootPaths {
          0 = Path/To/Your/Partials/  
      }
      templateRootPaths {
          0 = Path/To/Your/Templates/  
      }    
    }
    

    这意味着您使用的是Default.html模板

    要使用不同的模板,您还应该配置一些后端布局;假设您使用数据库存储它们,以前的代码可能变为:

    page = PAGE
    page.typeNum = 0
    page.10 = FLUIDTEMPLATE
    page.10{      
    templateName= TEXT
    templateName.stdWrap {
        cObject = CASE
        cObject {
          key.data = levelfield:-2,backend_layout_next_level,slide
          key.override.field = backend_layout
    
          default = TEXT 
          default.value = Default 
          //these are the IDs of the backend_layout records in DB  
          1 = TEXT
          1.value = Default
    
          2 = TEXT
          2.value = Home
          //add other values 
    
        }
    ifEmpty = Error
    }
    
      layoutRootPaths {
          0 = Path/To/Your/Layouts/  
      }
      partialRootPaths {
          0 = Path/To/Your/Partials/  
      }
      templateRootPaths {
          0 = Path/To/Your/Templates/  
      }    
    }
    

    另见:https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Fluidtemplate/Index.html

    如果您需要进一步的帮助,我建议您加入typo3 Slack Channels (订阅此处:https://forger.typo3.com/slack)并加入 typo3-cms Channels 和 fluidtypo3 Channels .

  • 4

    我认为你的typoscript文件不包含在 ROOT Template 中 .

    首先复制 typoscript.ts 文件中的所有typoscript并粘贴 setup.ts 中的 setup.ts 并检查前端 . 如果每件事情都没问题那么肯定你的typoscript不包含在 ROOT template 中如果这不起作用那么你的typoscript对象就会出现一些错误

相关问题