Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: web page title is blank when use PathInfo to show the global data item attached to the Page

$
0
0
no, the title tag is not empty , my razor template like this
...
@functions {
    ...
    Layout = "Layout.cshtml";
    ...
    C1PageRoute.RegisterPathInfoUsage();
}
@{
    Guid DataItemId = Guid.Parse(Function("Composite.Web.Request.PathInfoGuid", new { Segment = 0, FallbackValue = Guid.Empty }).ToString());
}
<html lang="@Lang" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://www.composite.net/ns/function/1.0" xmlns:lang="http://www.composite.net/ns/localization/1.0" xmlns:asp="http://www.composite.net/ns/asp.net/controls">
<head>
    <title>@CurrentPageNode.Title</title>
</head>
<body>
    @if (DataItemId == Guid.Empty)
    {
        @*
        get all data item
        show data item list 
        <ul>...</ul>
        check this url: http://xjfcms.hbhgkj.com/黄冈科技职业学院/新闻中心/学院要闻        
        title is ok
        *@
    }
    else
    {        
        @*
        var dataitem = Data.Get<theglobaldatatype>().Where(a => a.Id == DataItemId);
        show single data item
        check this url: http://xjfcms.hbhgkj.com/黄冈科技职业学院/新闻中心/学院要闻/ec5650c5-2597-4542-bc32-a0e55b06e504
        title is blank
        *@
    }
</body>
</html>
notice that : the title tag is not empty, but why the title is blank?

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>