Image not appearing from a Content Part with a Media Picker Field - orchardcms

I am trying to achieve the carousel and have got so far except not being able to show the image.
The sample can be found here http://www.stevetaylor.me.uk/image-carousel-using-twitter-bootstrap-and-orchard-cms-projections.
To replicate do the following:
1.Create a new content type
a. Creatable
b. Add Fields
i. Field Name: Image; Type: Media Picker;
ii. Field Name: Priority ; Numeric Field
2.Go to Admin>>Content. I would expect to see both the Image Url and Priority Value. However only see the Priority Value.
3.Create a project of the content type and list them on the home page using the default layout and same occurs only the Priority field is showing but no image.
I am running a fresh install of 1.6.1 with no extra modules.

The media picker field is not displayed in the Summary view by default. See this response to a similar question:
How to add Image Field to Blog Post Summary in Orchard CMS?
In short you need to add the following to your placement.info file:
<Match DisplayType="Summary">
<Place Fields_MediaPicker="Content:1"/>
</Match>
...and to display in admin list, include in the admin theme placement file:
<Match DisplayType="SummaryAdmin">
<Place Fields_MediaPicker="Content:1"/>
</Match>
Orchard's docs on placement: http://docs.orchardproject.net/Documentation/Understanding-placement-info

Related

Match tag in placement.info doesn't work in my case

I use Orchard CMS 1.10.1. I have a content type named "Animal" and I have a content Item named "Gold fish". This content item has a MediaLibraryPicker Field.
this field has a "Parts_Common_Metadata_Summary" that shows the create date. what I need is to not display this Create Date.
In Placement.info file of my current theme I added this Code to achieve my goal
<Match ContentType="Animal">
<Place Parts_Common_Metadata_Summary="-"/>
</Match>
This doesn't work but when I put the Place tag without Match tag it works.
My question is what is wrong with my match tag? what is the problem?
ps: ContentType Animal is correct and I also used nested Match tags for Display type Detail and summery also didn't work.
That is because the MediaLibraryPickerField renders another Meta part, specific for the image.
Try this in your placement.info:
<Match ContentType="Animal">
<Place Parts_Image_Metadata="-" />
</Match>

Render Orchard Widgets without a page

We would like our Orchard CMS homepage to contain only widgets and no content items. We have two approaches that work:
One. Create a page, title it Home, and set it as the current homepage. Then use placement.info to hide its parts:
<Match Path="/">
<Match ContentType="Page">
<Place Parts_Title="-"/>
<Place Parts_Common_Metadata="-"/>
<Place Parts_Common_Body="-"/>
</Match>
</Match>
This effectively gives us a homepage that displays only widgets. This approach, though, might confuse end users that add content to the site, because they will still see the "Welcome to Orchard!" page and wonder why its content isn't showing up on the site.
Two. Create a new content type called WidgetContainer, that only has the Autoroute part. Then create an instance of it called Home, and set it as the homepage. This is a better approach.
Is there another way to map www.ourdomain.ca to a container that displays only widgets?
Use this module: https://gallery.orchardproject.net/List/Modules/Orchard.Module.Contrib.Widgets
You can create a content type named Widgets Page for instance and add the widgets container part.

Modify the orchard search to display Meta Description, Link and Page Title

I need to modify the existing search module in Orchard such that it displays the Title and Meta Description in the search List.
First of all i added the meta content part to my content types and it is working as i wanted.
Now i don't know how to index Meta content part as there is no option to select the content part in Search Settings. As it is not indexed so when i search on the website Meta content part doesn't appear in shape tracing. As i want to display title, link and meta description in the the search results so i manage to display Title and the link but i don't know how to Meta description in the search result.
Just to play around i added following Meta Parts and content types but its not working
<Place Parts_Meta="Content:2"/>
<Place Parts_Meta_Description="Content:3"/>
<Place Parts_Metas="Content:4"/>
and many more but it seems to be not working.
I think as meta tags are not showing in indexing so may be because of that it is not getting displayed. I don't know exactly how to proceed with it, Please help.!
The search settings does not have Meta Parts or even i can not add it to indexing from the content part.
You don't need to modify the search module for this, just adjust the placement for your content type. The search module displays content items using the "Summary" display type. Use Shape Tracing to find all the properties you need to hide.
So, for example, if your Content Type is called Page then you want this...
<Match ContentType="Page">
<Match DisplayType="Summary">
<Place ...add placement info... />
</Match>
</Match>

Content part showing in admin

I have a custom content part, and I added it in a content item. it works fine, but there is a little problem in content items list on admin: the content part is appearing on it.
here is an image of my problem: http://imageshack.us/photo/my-images/163/2b68.png/
In the Placement.info in your module, add the following line:
<Match DisplayType="SummaryAdmin">
<Place Parts_MyPart="-"/>
</Match>

Orchard Placement file not hiding the Title Part

In Orchard I have a placement.info file that should hide the Title part when I view an Author:
<Match ContentType="Author">
<Place Parts_Title="-" />
<Place Parts_Breadcrumbs="-" />
</Match>
Author is a custom content type I've created and the Breadcrumbs Part is a custom part.
The breadcrumbs part is hidden, but the title is still displayed. If I inspect it with Shape Tracing it is definitely Parts_Title I want to remove, but the content of my placement file doesn't seem to work.
I do not have a whole of example to go on there, but it seems to me that this part is conflicting with the Parts_Title that ships with orchard.
Try extending the modifier in your placement as well as your shapes to something like:
Parts_MyModule_Title
This just adds some more clarity and can keep orchard from stepping all over itself.
Similar problem here.
This is because your custom part's Placement.info was loaded first and Orchard Title part was loaded after that overriding it.
To solve it, in your custom part's Module.txt, put a dependence on Title. This will force Orchard Title to be loaded first before your custom part.

Resources