Single-user Story?

Feb 4, 2011 at 7:57 AM

I'm currently looking around for an ASP.NET MVC 3 based blog engine to run a personal blog on--Orchard seems to be just about the only thing out there at the moment, but it doesn't seem to be very well geared towards the single-user single-blog scenario.

My first attempt seems to get me a very deep nested tree of html ([layout-main-container]..[content-item blog-post] -> 11 elements, which caused me a mild headache just thinking about the CSS selectors I'd need to write), three titles (website, blog, and post), and some really weird ordering of the actual post content (comments before text?) -- how much of that is easily modifiable without me putting in a couple dozen man-hours to wrangle it down?

Coordinator
Feb 4, 2011 at 8:02 AM

Everything... You can find what templates to override by looking into the views folders of the different modules (Orchard.Comments for comments). Relative ordering of the various templates for the different parts can be found and modified in placement.info files.

I'm a little puzzled about what theme you may be using that puts comments before text...

Feb 4, 2011 at 8:37 AM

I've looked at the views a bit, but can't make head nor tail of half of them.  For instance, Modules\Orchard.Blogs\Views\BlogPost\Item.cshtml contains only:

 

@Display(Model)

 

So, what do I do with that?  I can wrap some html around it, obviously, but how do I modify what Display(...) is going to output, without first finding where its defined?

As fore placement.info, The only documentation I can find that it was even a thing (thanks for pointing that out: I missed it on my first pass through the creating-a-theme wiki pages) is this wiki section, which really doesn't help: What does "Meta:3" mean? Where does Parts_Blogs_Blog_Description come from? What other attributes can I put on the <Place> element?

As for the theme that puts comments above the text, the default one does (actual content I posted in bold):

Test

Tags: A B C, D

Feb 3 2011 11:49 PM
0 Comments
This is only a test more


Coordinator
Feb 4, 2011 at 8:49 AM

That's because it has nothing to do but display the parts of a blog post, i.e. Body, Tags, comments, etc. Those are the templates you're looking for.

Placement files point at named zones. "Meta:3" means in a zone named "Meta" within the current scope, in third position. Parts_Blogs_Blog_Description is the name of the shape to place. Those are pretty much the only attributes afair, but you can look for Match tags in other placment files to find how you can narrow down placement to some circumstances.

As for the content appearing after the comments, I'm extremely puzzled: I really can't reproduce that. Can you describe exactly what you did? Oh wait a minute. Did you try when there are actual comments in there (it says 0)? Is that a post?

Coordinator
Feb 4, 2011 at 6:13 PM

I'd like to add that I'm taking your feedback very seriously and am working with the team on making all this easier to discover.

Feb 5, 2011 at 7:08 AM

I guess I'm getting a hang of the system now -- the docs could be better in this area, definitely, but it does make some sort of sense once you really start playing with it.

I still have no clue how to work with the placement.info files, though.  A couple questions to help clear that up a bit:

  • What benefit does it have over, say, explicitly laying things out in a given view .cshtml?
  • Where/how would this "Meta zone" be defined?
  • How would one go about discovering what shapes are available for a specific placement.info?
    • Are they all available everywhere?
    • Is there a list of them somewhere I have yet to discover?
    • Could there be such a list?

Would love to see the theme codegen stuff create (or have the option to) all of the files; or, at the least, some text files listing the files that you could copy to a folder to begin overriding them.

Coordinator
Feb 5, 2011 at 7:27 AM

Good questions. Well, you *could* explicitly lay out things, but if you did and added a new part to your existing type, you would have to go into all themes and update them to account for what you just added. Now with placement, it's the part that can specify its default placement and things happen collaboratively. The system is much more flexible and resilient to change because we've decoupled part layout from part placement. Makes sense?

The Meta zone (and other local zones for contents) is defined by Display(Model.Meta) in Orchard.Core/Contents/Views/Content.cshtml.

The shapes typically get created by drivers but there is a tool that you can use (http://orchardproject.net/gallery/Packages/Modules/Details/Experimental-1-0-20) that enables you to see all the names of the shapes being rendered in any particular page.

An option to create all possible shape templates is unfortunately impossible because shapes get created dynamically at run-time. It's not a predefined list, modules can add new ones, etc.