How to place different properties of one content type in two zones?

Topics: Administration, Customizing Orchard, General, Writing themes
Aug 11, 2011 at 11:15 AM

I have created a content type called "Product", which has following properties(fields).
1. Title
2. Description
3. Thumb Image
4. Large Image

The "Home Page" of the site has two separate zones to display "Product Slider" using JQuery slider and "Product of the Week".

Zone "Product Slider" -> this will show following properties (fields) of the "Product"
1. Title
2. Thumb Image

Zone "Product of the Week" ->this will show following properties (fields) of the "Product"
1. Title
2. Description
3. Large Image

The "Product List" is a list created to place it within a "Container Widget" to add it to a zone. Using "Custom Properties", the two container widgets capture 2 separate item sets.
I used the placement.info file to select the fields to display for the content type. This is the place I got stucked.

I was unable to show different fields as mentioned above separately for two zones, since both are under the same content type, in same page and same display type "Summary".
If I selected "Title", "Description" and "Large Image" fields to display for the content type (using placement.info), it'll show "Product of the Week" correctly, but not the "Product Slider", since it needs "Thumb Image" and "Title" instead of above selected.


What is the best possible way to do this without touching more coding? That means basically using placement.info, alternates or wrappers.

Thanks.

Coordinator
Aug 11, 2011 at 6:03 PM

From an alternate, you can add any Shape (or content) to another Layout zone. From a placement.info, you can just change the zone of the Content itself.
So I think you should be able to do it like that:



Layout.ProductOfTheWeek.Add(New.YourShape(), "5");
Layout.ProductOfTheWeek.Add("This is some text", "5");

Aug 13, 2011 at 10:26 AM

Thanks Sebastien for the reply.

But it is not clear me, how to add above code lines to add more shapes to the layout.

Anyway, i managed it by writing a module for the content type with 2 widgets for "Product Slider" and "Product of the Week". But I would like to know more about the above couple of code lines and application of it. 

If you can elaborate it more, it'll be a great help..

 

Thanks.

Coordinator
Aug 13, 2011 at 4:32 PM

Have you read this blog post ?

http://weblogs.asp.net/bleroy/archive/2011/07/31/so-you-don-t-want-to-use-placement-info.aspx

There are a few others from Bertrand explaining the Zones behaviors. It might help you.

Aug 19, 2011 at 5:22 AM

Thanks for the link Sebastien.

I read it, but now i'm facing a big performence issue with my first live site. It is loading very slowly for the 1st time. I read the article in "http://www.orchardproject.net/docs/Optimizing-Performance-of-Orchard-with-Shared-Hosting.ashx" and do necessary, but still the situation is same.

Any idea regarding this? I disabled unwanted modules but not removed them from "Modules" folder. Am i ned to remove them as well?

Aug 19, 2011 at 11:13 AM

I tried to use warmup module as a solution for this. But unfortunatly it is showing me the status as 0 and red color down arrow and no files generated in App_Data folder. I'm using 1.2 version of warmup module and it is created a txt file and a xml file inside the folder "App_Data/Sites/Default". But not that "App_Data/Warmup" folder as said in the documentaion for version 1.1.

My site is taking about 2 minutes to load for the first time. :( This is a very unexpected situation.

Coordinator
Aug 19, 2011 at 5:35 PM

Did this behavior appear like that, without any reason, or is it something you've been seeing since the beginning.

For the Warmup module, did you enter "/" inside the list of urls ?

Aug 22, 2011 at 4:14 AM
Edited Aug 22, 2011 at 4:23 AM
sebastienros wrote:

Did this behavior appear like that, without any reason, or is it something you've been seeing since the beginning.

For the Warmup module, did you enter "/" inside the list of urls ?

Once we type the URL and say Go, screen is blank for around 2 minutes and then only something can see on the page..

I have added the "/" for Warmup module. But no result... :(

Aug 22, 2011 at 6:34 AM

The Warmup xml file in "App_data/Sites/Default" contains following content. But no such files or folder named Warmup under "App_Data" directory.

- <WarmupReport>
  <ReportEntry RelativeUrl="/" Filename="http_3A_2F_2Flocalhost_3A40448" StatusCode="0" CreatedUtc="2011-08-22T06:12:51.0200729Z" />
  <ReportEntry RelativeUrl="/cej" Filename="http_3A_2F_2Flocalhost_3A40448_2Fcej" StatusCode="0" CreatedUtc="2011-08-22T06:12:53.0334461Z" />
  <ReportEntry RelativeUrl="/cej/about-us-overview" Filename="http_3A_2F_2Flocalhost_3A40448_2Fcej_2Fabout_2Dus_2Doverview" StatusCode="0" CreatedUtc="2011-08-22T06:12:55.0283133Z" />
  <ReportEntry RelativeUrl="/cej/about-us-our-history" Filename="http_3A_2F_2Flocalhost_3A40448_2Fcej_2Fabout_2Dus_2Dour_2Dhistory" StatusCode="0" CreatedUtc="2011-08-22T06:12:57.0572714Z" />
  <ReportEntry RelativeUrl="/cej/our-collection" Filename="http_3A_2F_2Flocalhost_3A40448_2Fcej_2Four_2Dcollection" StatusCode="0" CreatedUtc="2011-08-22T06:12:59.0521386Z" />
  <ReportEntry RelativeUrl="/cej/oforms-contact-us" Filename="http_3A_2F_2Flocalhost_3A40448_2Fcej_2Foforms_2Dcontact_2Dus" StatusCode="0" CreatedUtc="2011-08-22T06:13:01.0470058Z" />
  </WarmupReport>

Aug 22, 2011 at 6:48 AM
hasi wrote:

The Warmup xml file in "App_data/Sites/Default" contains following content. But no such files or folder named Warmup under "App_Data" directory.

 

- <WarmupReport>
  <ReportEntry RelativeUrl="/" Filename="http_3A_2F_2Flocalhost_3A40448" StatusCode="0" CreatedUtc="2011-08-22T06:12:51.0200729Z" />
  <ReportEntry RelativeUrl="/cej" Filename="http_3A_2F_2Flocalhost_3A40448_2Fcej" StatusCode="0" CreatedUtc="2011-08-22T06:12:53.0334461Z" />
  <ReportEntry RelativeUrl="/cej/about-us-overview" Filename="http_3A_2F_2Flocalhost_3A40448_2Fcej_2Fabout_2Dus_2Doverview" StatusCode="0" CreatedUtc="2011-08-22T06:12:55.0283133Z" />
  <ReportEntry RelativeUrl="/cej/about-us-our-history" Filename="http_3A_2F_2Flocalhost_3A40448_2Fcej_2Fabout_2Dus_2Dour_2Dhistory" StatusCode="0" CreatedUtc="2011-08-22T06:12:57.0572714Z" />
  <ReportEntry RelativeUrl="/cej/our-collection" Filename="http_3A_2F_2Flocalhost_3A40448_2Fcej_2Four_2Dcollection" StatusCode="0" CreatedUtc="2011-08-22T06:12:59.0521386Z" />
  <ReportEntry RelativeUrl="/cej/oforms-contact-us" Filename="http_3A_2F_2Flocalhost_3A40448_2Fcej_2Foforms_2Dcontact_2Dus" StatusCode="0" CreatedUtc="2011-08-22T06:13:01.0470058Z" />
  </WarmupReport>

 

This issue get resolved.. now there are files under warmup folder..