我刚刚开始使用复合c1 cms -我建立了一个基于剃刀/引导示例的站点,它工作得很好,但现在由于某种原因,页面标题无法显示。
相反,生成的标记如下:
<c1marker:marker xmlns:c1marker="http://www.composite.net/ns/asp.net/controls" key="[Composite.Function.Render.Asp.Net.Control.0]">
我从一个名为title of page的布局中调用一个页面模板特性:@PageTemplateFeature("Title of page")
此功能中的代码如下:
<html xmlns:f="http://www.composite.net/ns/function/1.0" xmlns="http://www.w3.org/1999/xhtml">
<head></head>
<body>
<div class="title">
<h1>
<f:function name="Composite.Web.Html.Template.HtmlTitleValue" /> 
</h1>
</div>
</body>
// -------------------------------------------------------------//
我已经发现了这个问题,以防其他人有这个问题,我使用的是基于HTML boilder plate的模板,HTML标记定义如下:
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->由于某些原因,除非我将xmlns属性添加到html标记中,否则它将无法工作:
<!DOCTYPE html>
<!--[if lt IE 7]>
<html xmlns="http://www.w3.org/1999/xhtml" class="no-js lt-ie9 lt-ie8 lt-ie7" lang="@Lang"> <![endif]-->
<!--[if IE 7]> <html xmlns="http://www.w3.org/1999/xhtml" class="no-js lt-ie9 lt-ie8" lang="@Lang"> <![endif]-->
<!--[if IE 8]> <html xmlns="http://www.w3.org/1999/xhtml" class="no-js lt-ie9" lang="@Lang"> <![endif]-->
<!--[if gt IE 8]><!--> <html xmlns="http://www.w3.org/1999/xhtml" class="no-js" lang="@Lang"> <!--<![endif]-->
<head>发布于 2017-09-13 00:05:49
根据documentation,您必须插入它,以确保您的模板在使用特定的C1 CMS XML元素进行呈现、函数等时是有效的。
您可能已经注意到,代码是用HTML编写的,而不是。(请在“仔细查看模板标记”一章中阅读有关名称空间和XHTML的更多信息(很抱歉,由于提供链接的堆栈溢出限制,我无法正确附加链接,但这里有空格- "https: //docs.c1.orckestra.com/ Layout/Xml-Templates/A-Closer-Look-at-the-Template-Markup#_A_Closer_Look").)
简而言之,如果你想让CMS正常运行,建议使用它,它不仅仅基于HTML,当然它使用HTML,但它也使用其他语言。页面的大部分是从发出XHTML文档的函数生成的-例如,Razor函数或XSLT函数。Here is Reference,如果你想通过的话。希望我能澄清你的疑问。
https://stackoverflow.com/questions/18718842
复制相似问题