This project is read-only.

Blog post - add hyperlink back to Blog list

Topics: Customizing Orchard
Mar 31, 2014 at 12:29 AM
Edited Mar 31, 2014 at 12:39 AM

Is there a simple way using the overrided view/shape Content-BlogPost.cshtml to add a hyperlink at the bottom of the post that routes back to the blog list page.

So you can click through to a blog post and have a link back to the list

When I add custom code to Content-BlogPost.cshtml it also shows up on the blog list page as well. I have also overrided that shape with Parts.Blogs.BlogPost.List.cshtml but it seems Content-BlogPost.cshtml affects both the list and the bolg post?

Is this possible using the code below?

@using Orchard.Utility.Extensions;
if (Model.Title != null) {
    Layout.Title = Model.Title;


var contentTypeClassName = ((string)Model.ContentItem.ContentType).HtmlClassify();

var tag = Tag(Model, "article");
    @if (Model.Meta != null) {
        <div class="metadata">
@if(Model.Footer != null) {
Mar 31, 2014 at 11:32 PM
Create an alternate called Content-BlogPost.Detail.cshtml - That way it wont show in the List.

FYI: The list view shows the Summary view of the BlogPost, not the Detail view.
Apr 10, 2014 at 3:04 PM
thanks all fixed using that alternate