Add layout for all blog posts Orchard CMS - layout

I'm trying to add layout for all blog posts. I have added part Layout for BlogPost content type. Now I can add layout for blog post one by one. So, how I can add existing layout for all blog posts in blog?

You should create a Layout from /Admin/Contents/Create/Layout, save it and then in your blogposts, use the option "Use existing layout: " in order to get your layout.

You can do it by adding new layer with ContentType rule, like this:
ContentType("BlogPost")
Then you can add your blog post special widgets to this layer including a Layout Widget, as you want.

Related

Adding blog to specific page using Orchard CMS

I need to add existing blog to page. How I can do that?
I have page with layout and I need to add blog with pagination for it.
You can create a query with for content type blog posts as a filter and then you can add a projection widget based on this query to your page layout.

How to style the 'blog' in orchard CMS

How can I style the 'Blog' for which I added via Orchard CMS dashboard.
For some reason, this section: Once added, adds fine, but is just black & white with 0 styles included from the rest of the site. I'm trying to figure out how to style this with the rest of the site.
With the /Styles/
Folder I have tried:
/menu.blog-admin.css
/orchard-blogs-admin.css
/orchard-blogs-archives.css
But none of these styles I've added to any of these files rendered. Any advice?
The best place to start will be in Orchard Docs
You will need to add your styles, script and other content as Orchard Resources, by implementing IResourceManifestProvider and adding your styles. Then in, your blog views you can use Style.Require('YourStyle').
Here's how in this page of Orchard Docs
Use Shape Tracing to identify files which you may wish to override
Read about Alternates
To quickly just add a style try this answer

How to change orchard blog home page list view/summary view

I have Orchard 1.7 setup with blog recipe.
The home screen display a list of blog posts.
I want to override the way the content is displayed in summary view. I could do this for each parts. But my styling is such that I need to wrap title, body, and meta tags with a special div when ever the display type is summary.
The problem is:
After shape tracing I understood that the template used in the home page (summary) is same as the detailed one.
Content.cshtml
For detail view I want to use the default core-> Views/Content.cshtml but for summary I need to supply my own. How can I do this?
OR
How to write a driver/widget to the home page. I know how I can do this for parts/fields/modules but I don't have an idea on how to create a driver for Blog home page.
Whenever I add a widget to the homepage the default blog post list still get displayed.
Just create a file called Content.Summary.cshtml in your theme. This will target all summary views, so if you have more than just blog posts on your site you will probably want to have Content-BlogPost.Summary.cshtml.
I wrote a small blog post on Item templates in Orchard if you are interested... http://arkleseizure.net/what-the-hell-is-an-item-template

Use alternate shape template for content inside Projection

I have a simple Content Type, let's say BlogPost. I want a widget "Recent blog posts". I know it exists as out of the box widget for Blog Posts. But we are imagining a generic Content Type here in place of Blog Post. I want to create it as a Projection Widget.
I made a Query, created projection widget, named it "Latest Blog Posts", and it works fine.
Now I would like to specify exact template that each of the blog posts in that projection list should use when displaying.
Currently, here are my options for shape alternates in this situation:
So, in the left pane:
Widget is a Projection Widget I created. It uses a Query on Blog Post content types with grid layout. Each of the "Content" items in the left pane represent one of the Blog Post that the projection is showing.
Now, for example, I would like each of the Blog Posts to be shown in a short variant. I don't want to override BlogPost.Summary shape template since I may need that shape somewhere else on the site.
In the right pane I have all of the available alternates for a single Blog Post shape inside a projection widget.
Ideally, I would like to have an alternate shape template called something like:
"~/Themes/Bootstrap/Views/Content-BlogPost.Summary.LatestBlogPosts.cshtml"
After that I would go for:
"~/Themes/Bootstrap/Views/Content-BlogPost.Summary.ProjectionWidget.cshtml"
Or anything of that kind in order to have special shape template for showing a blog post inside a projection widget.
My alternative approach was using the Placement.info file. I wanted to hide certain parts of a BlogPost:
<Match ContentType="ProjectionWidget">
<Place ShapeParts_Common_Metadata_Summary="-" />
<Place Parts_Tags_ShowTags="-" />
<Place Parts_Common_Body_Summary="-" />
</Match>
This segment does nothing. I haven't been able to make it work yet.
So, I hope I made my problem clear. I want to be able to specify the exact look of a Blog Post when it is showing in a Projection Widget. How can I do this?
It's way easier to change the display type.

In Orchard CMS, how do I customize the Blog widget?

I'm still new to Orchard and don't quite understand how it fits together.
The home page shows a blog post list, which is what I want. Except that right on top of the list is a summary of the blog. I only want the blog entries to show and not the general blog summary/header.
How do I customize the Blog widgets(?) to not show the summary/header?
I am using a custom derivative of the "TheThemeMachine" theme.

Resources