0
我有以下片段。我试图用开放的图形标签来扩展基本片段“头部”......但是呈现的页面仅包含片段/头部的标签,以及og ones。在Thymeleaf中扩展片段
我怎么可以添加更多标签片段?
<head th:include="fragments/head :: head">
<!-- You can use Open Graph tags -->
<meta property="og:url" th:content="${url}" />
<meta property="og:type" content="website" />
<meta property="og:title" content="GUApp" />
<meta property="og:description" th:content="${description}" />
<!--<meta property="og:image" content="http://www.your-domain.com/path/image.jpg" />-->
</head>
<head th:fragment="head" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
....
</head>
它应该根据文档的作品,BU t ... 无法解析为片段选择:“fragments/head :: head(〜{:: meta})”(concorso:4)
< - 您可以使用Open Graph的标签 - > <元属性= “OG:标题” CONTENT = “GUApp”/> <元属性= “OG:描述” 个:内容= “$ {描述}”/ > <! - - > – Progeny@Progeny您使用Thymeleaf 2?因为我觉得灵活的布局,仅在第3版。如果不能切换,可以试试[参数化的片段签名(http://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#parameterizable-fragment-签名)并路径一些'Map <'property','content'>'而不是标签块。 – varren