0

I'm building a site with Fluid Template. I have created two different front-end layouts and two different back-end layout but I always get this error #1288085266: No template has been specified. Use either setTemplateSource() or setTemplatePathAndFilename(). Accordingly to Typo3 Wiki this should be a solution Exception/CMS/1288085266

but not in my case. This is my code:

config.doctype = html5

page = PAGE
page {
	includeCSSLibs.bootstrap = https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css
	includeCSS.style = fileadmin/templates/rka2015/css/style.css
	
	includeJSlibs.jquery = https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
	includeJSlibs.bootstrap = https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js
	includeJS.custom = fileadmin/templates/rka2015/js/custom.js
}
	
page.10 = FLUIDTEMPLATE
page.10 {
		
		file = fileadmin/templates/rka2015/layouts/main_layout.html
		layoutRootPath = fileadmin/templates/rka2015/layouts/
		patialRootPath = fileadmin/templates/rka2015/partials/
		
		variables {
			siteName = TEXT
			siteName.value = rka2015
			
			contentMain < styles.content.get
			contentMain.select.where = colPos = 0
			
			content_column_1 < styles.content.get
			content_column_1.select.where = colPos = 1
			
			content_column_2 < styles.content.get
			content_column_2.select.where = colPos = 2
	}		
}


page.10.file.stdWrap.cObject = CASE
page.10.file.stdWrap.cObject 
	{
    key.data = levelfield:-1, backend_layout_next_level, slide
    key.override.field = backend_layout
    
    default = TEXT
    default.value = fileadmin/templates/rka2015/main_1_column.html
    1 = TEXT
    1.value = fileadmin/templates/rka2015/main_1_column.html
    2 = TEXT
    2.value = fileadmin/templates/rka2015/main_2_column.html
}

I have already checked all; section name is OK, ID for back-end layouts are ok, template is defined, everything seem to be as it should be. I really don't have a clue where else to search.

UPDATE!!!

Seems like there is a problem with a file path. I am running my site on a subdomain and it looks like that ts doesn't find the file paths if they are defined only as fileadmin/... Any thoughts? Thanks

SOLUTION!

page {
	includeCSSLibs.bootstrap = https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css
	includeCSS.style = fileadmin/templates/rka2015/css/style.css
	
	includeJSlibs.jquery = https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
	includeJSlibs.jquery.external = 1
	includeJSlibs.bootstrap = https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js
	includeJS.custom = fileadmin/templates/rka2015/js/custom.js
}

page.10 = FLUIDTEMPLATE
page.10 {
    template = CASE
    template {
      key.data = levelfield:-1,backend_layout_next_level,slide
      key.override.field = backend_layout

      1 = FILE
      1.file = fileadmin/templates/rka2015/main_1_column.html

      2 = FILE
      2.file = fileadmin/templates/rka2015/main_2_column.html
    }
    partialRootPath = fileadmin/templates/rka2015/partials/
    layoutRootPath = fileadmin/templates/rka2015/layouts/
    variables {
	
			siteName = TEXT
			siteName.value = rka2015
			
			contentMain < styles.content.get
			contentMain.select.where = colPos = 0
			
			content_column_1 < styles.content.get
			content_column_1.select.where = colPos = 1
			
			content_column_2 < styles.content.get
			content_column_2.select.where = colPos = 2
  }
}

4

2 回答 2

0

首先,检查 TYPO3 是否可以通过将其附加到模板末尾来覆盖页面对象来读取文件:

page.10 >
page.10 = FILE
page.10.file = fileadmin/templates/rka2015/layouts/main_layout.html

如果这没有生成包含模板文件的原始、未解释的输出的页面,那么文件路径或文件权限有问题。

其次,在 Fluid 中,模板和布局是不同的东西,用途不同,不应该放在同一个目录下。

最重要的是,您尝试使用 page.10.file.stdWrap.cObject 中的 CASE 构建的后端布局开关有问题。你看,stdWrap 对象实际上环绕了你已经设置的文本。如果 stdWrap 找不到管道来确定如何包装,它只是追加。删除您在顶部设置文件的行,只留下 stdWrap 案例,您应该一切顺利。

于 2014-11-08T20:59:18.830 回答
0

乍一看,它看起来是正确的……但请检查您的文件路径,也许它们是错误的,正如“Jost”所评论的那样。

我不确定,但我认为问题在于模板路径(文件 = ...)与布局根路径相同...

顺便说一句...如果您包含外部样式和javascript,您需要设置如下我认为...

includeJSlibs.jquery = https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
includeJSlibs.jquery.external = 1
于 2014-11-06T18:07:26.973 回答