Delete / hide orchard authoring and date from content? - orchardcms

Is it possible to hide or delete the date and author that appears at the end of every content added to Orchard? I can't find any way to do that from the Dashboard :(
I have Orchard 1.6.0 and Bootstrap theme.
Below is an image of what I'm trying to quit / hide:
Thanks for the help. Have a great day.

Hide them by adding this to your theme's Placement.info:
<Match DisplayType="Detail">
<Place Parts_Title="-"/>
<Place Parts_Common_Metadata="-"/>
</Match>
<Match DisplayType="Summary">
<Place Parts_Title="-"/>
<Place Parts_Common_Metadata="-"/>
</Match>
You can use Orchard's shape tracing feature to identify these parts and then show/hide them in your placement.info.

I too am playing with the Bootstrap theme and found that Mohammad's script hid more than was necessary as well as caused the content to start, hidden underneath the header.
The following, in {Theme Folder}/Placement.info, achieved the desired result as yenssen desired:
<Placement>
<Match DisplayType="Detail">
<!--<Place Parts_Title="-"/>-->
<Place Parts_Common_Metadata="-"/>
</Match>
<Match DisplayType="Summary">
<!--<Place Parts_Title="-"/>-->
<Place Parts_Common_Metadata="-"/>
</Match>
...

Related

How to add image to blog in summary of orchard cms

I want to add image to the summary of blogs in Orchard CMS. How do I add it to the summary?
Use Placement.info. In your theme's placement.info add something like this:
<Match ContentType="Blog">
<Match DisplayType="Summary">
<Place Fields_MediaLibraryPicker="Content:1" />
<!-- Or: <Place Fields_MediaLibraryPicker_Summary="Content:1" /> -->
</Match>
</Match>
See this source code to see which shapes are available for this.
Note: I am assuming here that you are using the media library picker field to attach an image to your blog. If you use something else, you should use that shape.

Remove metadata from List item with placement.info in Orchard

I created two content types, Foods with the containable part, and Colors with the container part. I created a list of colors that contain foods inside them following Bertrand's example here: http://weblogs.asp.net/bleroy/many-ways-to-relate-orchard-things-part-3-lists
Example:
green: avocado, kale, spinach
red: strawberry, raspberry, ketchup
On the page for "green" and "red" I am trying to remove the metadata. I tried this code:
<Match ContentType="Food">
<Match DisplayType="Summary">
<Place Parts_Common_Metadata="-"/>
</Match>
</Match>
And the metadata was still there, so I tried this code to make sure I didn't have any typos:
<Match ContentType="Food">
<Place Parts_Common_Metadata="-"/>
</Match>
Again, the metadata was still there for the list view pages, but as expected it did remove the metadata from the display view pages.
I am able to remove the metadata through a Content-Food.Summary.cshtml but I know the preferred method is to use the placement.info file.
Is this possible? If not, is it a feature or a bug?
There are two different views for the Metadata, one for the summary and one for the detail. This is good because it means you can customize how the metadata is displayed in the summary vs the detail, but slightly confusing when you are starting out.
So all you need to do is use this:
<Match ContentType="Food">
<Match DisplayType="Summary">
<Place Parts_Common_Metadata_Summary="-"/>
</Match>
</Match>
Note the Parts_Common_Metadata_Summary

Orchard 1.8 Unable to hide metadata (published date) from custom part using Placement.info

I have a Placement.info at the root of my custom part folder.
<Placement>
<Place Parts_Common_Metadata="-" />
<Place Parts_MyCustomPart="Content:2" />
</Placement>
MyCustomPart displays fine. However, this doesn't hide the metadata. Using Shape Tracing, I managed to identify which Placement.info file was being loaded/processed that displays the metadata. It is ~/Core/Common/Placement.info containing the rule
<Placement>
<Match DisplayType="Detail">
<!-- Removed for brevity -->
<Place Parts_Common_Metadata="Meta:2" />
</Match>
</Placement>
I suspect that MyCustomPart/Placement.info was being loaded/processed first. And ~/Core/Common/Placement.info is loaded after that effectively overriding Parts_Common_Metadata in the previous Placement.info.
Is there a way to define the order of which Placement.info is loaded/process first?
Take a dependency on "Common" from your module.txt manifest file. This will let you take precedence.

How to add Image Field to Blog Post Summary in Orchard CMS?

Looking to display the Image Field in the Blog Post Summary on my Orchard site. It current displays on the blog post itself but not in the summary. How do I add it to the summary?
The display of parts and fields is defined in the placement.info files found in each module. Assuming you're using the Image Field from the Contrib.ImageField module, You will need to override the default placement of the field for the summary display type (which is defined in Modules\Contrib.ImageField\Placement.info) which by default is:
<Match DisplayType="Summary">
<Place Fields_Contrib_Image="-"/>
</Match>
You can do this by adding the following to your theme's placement.info file (note I have restricted this to the BlogPost content type only) e.g.
<Match ContentType="BlogPost">
<Match DisplayType="Summary">
<Place Fields_Contrib_Image="Content"/>
</Match>
</Match>
This displays the image in the Content zone for the summary view of BlogPost content items. For more info on placement in Orchard see http://docs.orchardproject.net/Documentation/Understanding-placement-info
You can use the Media Library Picker Field.
I did the following steps to add image field to blog summary:
add Media Library picker field to Blog-Post content Type
then in the placement.info add the following
<Match ContentType="Blog">
<Match DisplayType="Summary">
<Place Part_Image_Summary="Content">
</Match>
</Match>

Orchard CMS - Remove Title and Metadata(published date) in a post

How do I remove the Title and Metadata(published data) in a post? Can this be done in Placement.info? I tried creating a custom content but doesn't look like a best solution. I just done it with CSS but I know this could be done in another way.
You can edit the Placement.info file in your current theme's root folder to not display the title and publish date:
<Placement>
<Match DisplayType="Detail">
<Place Parts_Title="-"/>
<Place Parts_Common_Metadata="-"/>
</Match>
<Match DisplayType="Summary">
<Place Parts_Title="-"/>
<Place Parts_Common_Metadata="-"/>
</Match>
</Placement>
See this post for further details: Orchard: Anatomy of a theme
Also, in case you are wondering where names like Parts_Title come from, see Customizing Orchard using the Designer Helper Tools (specifically shape tracing).
Alternatively, if you want to keep the title meta in the head whilst removing the title on every page create a Parts.Title.cshtml file in the view folder of your theme and then put
#{
Layout.Title = Model.Title;
}
which is exactly the same as the normal code except we remove the <h1> tag
#{
Layout.Title = Model.Title;
}
<h1>#Model.Title</h1>

Resources