0

I've just started using composite c1 cms - I set up a site based on the razor / bootstrap example which was working fine but now for some reason the page titles are not displaying.

Instead the markup that is produced is as follows:

<c1marker:marker xmlns:c1marker="http://www.composite.net/ns/asp.net/controls" key="[Composite.Function.Render.Asp.Net.Control.0]">&nbsp;

I'm calling a page template feature from a layout called title of page: @PageTemplateFeature("Title of page")

The code in this feature is as follows:

<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" />&#160;
        </h1>
    </div>
</body>

// -------------------------------------------------------------//

I have found the issue in case anyone else has this problem, I was using a template based on HTML boilder plate, the HTML tag was definind as follows:

<!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]-->

For some reason, it would not work unless I add the xmlns attribute to the html tag:

<!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>
Andy Roper
  • 403
  • 1
  • 5
  • 12
  • Just checked on v. 4.0, Open Cph / Razor starter site. Working OK. I created a page template feature called "Title of page", added your markup which calls on "Composite.Web.Html.Template.HtmlTitleValue", called the feature from the "2 columns, content and aside" Razor-based template, checked the pages based on this template in a browser, e.g. "How to edit this website" The title appears as expected. Do you do anything different from the above? Where does the title not appear in your case? Thanks – wysocki Sep 11 '13 at 06:18
  • Hi, yes if I do the same as you I get the title showing just fine. I must have changed something in this particular site which has broken this feature, I have no idea what I've done currently.... – Andy Roper Sep 11 '13 at 08:22
  • I have also tried creating a new site, not removing anything from it, creating templates and a master layout based on my existing site and the title does not appear. I am assuming there is something either in the template or the master layout that is not in my template or master layout? – Andy Roper Sep 11 '13 at 09:10
  • Can you give a more specific repro please? With as much detail as possible. If there is a bug here we would like to log it and have it fixed. – wysocki Sep 11 '13 at 11:42
  • Just to clarify: 1. In the starter site (Razor) the Composite.Web.Html.Template.HtmlTitleValue function is called in the page template feature called "Hero unit (default)". 2. The feature in turn is called in the Layout.HeroUnit function. 3. An this very Layout.HeroUnit function is called from page templates like "2 columns, content and aside" etc. Might it be that you missed some of these "levels"? – wysocki Sep 11 '13 at 11:48
  • Hello, see my answer above with regards to the html tag - it works fine if the xmlns attribute is included in the html tag but if I remove this then it fails. – Andy Roper Sep 12 '13 at 07:42

1 Answers1

0

As per documentation You have to insert that to ensure that your template should be valid with the use of the specific C1 CMS XML elements for rendering, functions and so on.

You might have also noticed that the code is written in XHTML, not HTML. (Read more on the namespaces and XHTML in the chapter “A Closer Look at the Template Markup” (Sorry due to stack overflow limitation of providing link i cant attach link properly but it is here with spaces- "https: //docs.c1. orckestra . com/ Layout/Xml-Templates/A-Closer-Look-at-the-Template-Markup#_A_Closer_Look").)

In Short its recommended to use it if you want CMS to function properly, Its not based on only HTML Of course it is using HTML but it is using other languages too. Most of the part of page is generated from functions that emits an XHTML document – for instance, Razor Functions or XSLT Functions. Here is Reference if you like to go through. Hope I clarify your doubt.