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

New Post: Blog - Display current tag

$
0
0
Hi!

You can make use of
Composite.Core.Routing.Pages.C1PageRoute.GetPathInfo()
to get the path info and append it to the title in the Composite.Community.Blog.BlogRenderer function.

Something like I have added in else {} below:
<head>
    @if (IsBlogItem)
    {
        <title>
            @CurrentBlogItem.Title
        </title>
        <meta name="description" content="@CurrentBlogItem.Teaser" />
    }
    else
    {
        string pathInfo = Composite.Core.Routing.Pages.C1PageRoute.GetPathInfo();
        if (String.IsNullOrEmpty(pathInfo) == false)
        {
            <title>@CurrentPageNode.Title - @pathInfo.TrimStart('/')</title>
        }
    }
    <link rel="alternate" type="application/rss+xml" title="@CurrentPageNode.Title" href="/BlogRssFeed.ashx?bid=@CurrentPageNode.Id" />
    <link id="BlogStyles" rel="stylesheet" type="text/css" href="~/Frontend/Composite/Community/Blog/Styles.css" />
</head>
Please note that the code above will equally show the date (year/month) gotten from the path info
if the user clicks an entry in the Blog's "Archive" and filter the blog posts by dates

Just fine-tune it the way you like :)

/Vitaly

Viewing all articles
Browse latest Browse all 2540

Trending Articles