Blogs: Show some posts in home

Topics: General
Sep 11, 2013 at 5:18 PM
Hello again!

I'm building my first Orchard site with 1.7. It consists of three blogs where the user publishes different content. In the home, which is not a blog, I need to show only 3 posts: the last of the first blog, the first of the second blog and the first of the third blog.

Can you please give me some guidance to find the best way of doing this??

Thanks!
Coordinator
Sep 11, 2013 at 5:41 PM
You can do this using two queries which would be displayed as widgets on the home page. Do you know queries and projections in Orchard ?
Sep 11, 2013 at 5:42 PM
No idea, I'm really new at this.

Some links I can look to to learn things and come here with questions later?

Thanks!
Coordinator
Sep 11, 2013 at 5:46 PM
You could watch this old videos when we first presented the module: http://www.youtube.com/watch?v=SP912eWoOoo

Someone might have better suggestions, I confess I never look at docs as I wrote the module ;)
Coordinator
Sep 11, 2013 at 5:47 PM
Oh, and David Hayden's articles for sure: http://www.davidhayden.me/blog/projector-module-in-orchard-cms
Sep 11, 2013 at 5:51 PM
Thank you sebastien!

I will look at the info you provided me and come here later to tell how I'm going!

:)
Sep 11, 2013 at 11:31 PM
Edited Sep 11, 2013 at 11:32 PM
Another question!

So apparently I'm doing fine with the projection by now thanks to the video, I still have work to do but is seems ok.

I have a question related to a Content Field I added to the Blog Content Type. I added a field "Called Subtitle" that should be displayed after the title of the blog. I have 2 problems with this:
  1. When rendering the field in the site it is being displayed after a datetime value. I modified the placement (edit placement option in the content type editor) and put it right after the title like this:
Image

But it still gets displayed after a Date time that I don't know where it comes from:

Image
  1. As you can see in the image above I don't need that date between the title and the posts and I also don't need the Content Field Title "Subtitle:" before the text.
Can you please guide me with this??

PS: Should I open I new thread for every different question I have or can I ask similar or related questions in the same thread?
Coordinator
Sep 12, 2013 at 5:46 AM
Sep 13, 2013 at 3:39 PM
Hi bertrand, thanks for your answer.

I'll take a look at the article you sent me but can you please confirm me if modifying the placement.info can I remove the "Subtitle:" title of the field I created?
Sep 13, 2013 at 4:39 PM
Just to add another question...

Looking at the functionality of the projector module, which is pretty nice, I realized I need two queries but those 2 queries should be displayed in the same Projection (page).

Is there any posibility to do that?

The reason they should be 2 queries is because they have different layouts so using Queies Groups doesn't work for me...
Coordinator
Sep 13, 2013 at 9:53 PM
You can remove any shape from placement by sending it to "-" instead of sending it to a zone.

No, you can't use two different queries in a projection. I suppose we could have something like a projection field, of which you could have more than one. Maybe you could work around this with widgets?
Sep 13, 2013 at 10:40 PM
Edited Sep 13, 2013 at 10:40 PM
BertrandLeRoy wrote:
You can remove any shape from placement by sending it to "-" instead of sending it to a zone.

No, you can't use two different queries in a projection. I suppose we could have something like a projection field, of which you could have more than one. Maybe you could work around this with widgets?
Hey Bertrand, I didn't get your las suggestion about the projection but I think the problem is my lack of deep knowledge at this time.

May I ask you, is there any posibility of adding body content to a projection or the only thing a projection supports is showing queries results?

If I need show the blog publications like I wrote in the first post, but I also need to add some text before the results (projection queries), what would be your suggestion to achieve that?

Many many thanks for your help and patience!
Coordinator
Sep 14, 2013 at 12:03 AM
A projection is a content type like any other, so yes, you can add a body part, fields, etc. Adding a body part is exactly the right way of implementing the scenario you described.
Sep 16, 2013 at 6:27 PM
Edited Sep 17, 2013 at 7:50 PM
BertrandLeRoy wrote:
A projection is a content type like any other, so yes, you can add a body part, fields, etc. Adding a body part is exactly the right way of implementing the scenario you described.
That's absolutely awesome! Thanks!!
I can see how pieces fit little by little! I will play with your suggestion later and see how it goes!

BertrandLeRoy wrote:
Edit the placement file in your theme instead. http://docs.orchardproject.net/Documentation/Understanding-placement-info
About this suggestion to hide what I needed to hide I've been playing with the placement.info file modifying things and seeing what happens.

These are some fields I defined for the BlogPost ContentType:

First Image
Image

So far I have this as my placement.info:
<Placement>
 
  <Match ContentType="BlogPost">
    <Match DisplayType="Summary">
      <Place Fields_Boolean-Destacada="-" 
             Parts_Common_Body_Summary="-"
             Parts_Comments_Count="Content:after"/>
    </Match>
    <Match DisplayType="Detail">
      <Place Fields_Boolean-Destacada="-" 
             Fields_Common_Text-Content="-" 
             Parts_Comments_Count="Content:after"/>
    </Match>
  </Match>

</Placement>
The problem is that "Subtitle" and "BriefContent" fields render the displayName before the content and I need to show the content only. As you can see in the image at the end of this post there is a line that says:

"Subtitle: Las mismas palabras de antes para describir unas imágenes tan distintas."

I need to show it only as:

"Las mismas palabras de antes para describir unas imágenes tan distintas."

The same happens with "BriefContent" field. How can I hide the displayName that is rendering before the actual content of the field?

Second Image: (Adult content. Viewer discretion is advised)
http://s8.postimg.org/6pufxs51h/Fields_Render.png

Many thanks!
Coordinator
Sep 17, 2013 at 6:52 PM
Could you please avoid the soft porn images on these forums? That's completely gratuitous, and there are places for that sort of thing.

To remove the labels, just override the templates that render the fields.
Sep 17, 2013 at 7:48 PM
Edited Sep 17, 2013 at 7:51 PM
BertrandLeRoy wrote:
Could you please avoid the soft porn images on these forums? That's completely gratuitous, and there are places for that sort of thing.

To remove the labels, just override the templates that render the fields.
Bertrand, sorry about the image. It is from the site I am migrating and has nothing to do with soft porn, that's art and that's a site that belongs to a professional designer and photographer.

Anyway, if you felt offended about the image I will remove it, though I think you could be more tolerant and open minded since is obvious what is the purpose of the image.

Thanks for the explanation, it was helpful.
Coordinator
Sep 17, 2013 at 7:50 PM
Edited Sep 17, 2013 at 7:50 PM
I'm not offended in the least, but lots of diverse people read these forums. I am however slightly offended by the nopology. It is not apologizing to question my tolerance ond open-mindedness.
Sep 17, 2013 at 7:57 PM
Edited Sep 17, 2013 at 7:59 PM
BertrandLeRoy wrote:
I'm not offended in the least, but lots of diverse people read these forums. I am however slightly offended by the nopology. It is not apologizing to question my tolerance ond open-mindedness.
My bad Bertrand, I didn't meant to question that... I just felt your petition a little bit out of the place but that's something that happens when the only interaction is based in writing and reading, it is easy to misunderstood things and I think I did when I read your petition.

Please accept my apology!

:)

Thanks again.
Coordinator
Sep 17, 2013 at 8:36 PM
No problem, thanks.
Sep 30, 2013 at 5:53 PM
I know that crosposting is something bad but @BertrandLeRoy (or anyone else) can please take a look at the last post of this thread an answer some of the questions?

Thanks!!

https://orchard.codeplex.com/discussions/456851