This project is read-only.

New Blog in Orchard 1.1

Topics: General
Apr 16, 2011 at 6:21 PM

Has anyone tried creating a new blog in Orchard 1.1? I did this and then created a basic first post. My blog appears on my page but it does not list the posts. Is there a setting I am missing or a missing content part?

Apr 16, 2011 at 6:26 PM

Blog posts should be listed.

Can you describe your steps to get where you are;

- Zip file or source enlistment?

- Is it an upgrade from 1.0?

- Default theme or another?

- When installing, which Recipe did you use?

Apr 17, 2011 at 1:38 PM
It is zip file, fresh 1.1 install, my own theme, default recipe.

Blog gets added with no errors, and the post gets added. But on the landing page for the blog, no entries are appearing.



Apr 17, 2011 at 2:07 PM

It looks like Parts.Blogs.BlogPost.List.cshtml is not even being called when I step through in the debugger. Strange.

Apr 17, 2011 at 5:29 PM

From the above it looks like the place to focus is your theme.

Before going any further, can I ask you to switch back to TheThemeMachine and tell me if the blog posts list correctly on that theme? (They should do)

Assuming this, we need to look at what files you've overridden in your theme.

Could you for reference just list every cshtml file that you're overriding in your theme?


Apr 17, 2011 at 5:31 PM

BTW; breakpoints don't seem to get hit in cshtml files, I've experienced this at least. Doesn't mean the file isn't getting called. The easy way to confirm this is to add some junk text like "Foo!" into the cshtml file and see if it gets displayed.

Apr 17, 2011 at 5:33 PM
I just reverted to the ThemeMachine and my blog page still does not list my blog entries.

I am hitting the permalink for my blog, is there a separate URL for all postings? I also trued to add the "Recent Blog Posts" widget and that worked, showing my post.

Still no luck though.



Apr 17, 2011 at 5:38 PM
Yea I noticed that. What is being output is basically:

<article class="content-item blog">

My Blog Title


My Blog Description


No items of the blog are being rendered.



Apr 17, 2011 at 5:48 PM

Hmm ... I'd have to double check this (but I doubt something so obvious as missing blog posts could have slipped past the testing process) - the posts should definitely be listed in Summary form on the blog landing page.

Are you sure you haven't modified any core files? (Or anything in TheThemeMachine)

Something else you could try is deleting the cache file from App_Data. I've noticed people mentioning cache issues where data isn't updated straight away.

Apr 17, 2011 at 5:53 PM
Yea I agree.

I could try and spin up a new site from the downloaded and see if it works. I will post back my findings.

I have added modules, added my own theme, added some placement files, etc. But I have tested reverting all of those.

Let me try a fresh install and see what happens.



Apr 17, 2011 at 6:08 PM

Any enabled modules could be changing things. Also any themes, even if they aren't current, just being enabled can be enough for certain things to take effect.

It's most likely a placement file, on the other hand it could be an exception occurring in a Driver stopping those shapes displaying.

So I think that by eliminating modules and themes from play you should find the source of the problem.

Apr 17, 2011 at 10:46 PM
With a fresh install the blog works fine. I guess I am going to have to start disabling modules.



Apr 17, 2011 at 11:35 PM
Any thought on my it is skipping this view file?


In the clean install it hits this file, but in my working copy it does not. This is what renders the posts.



Apr 18, 2011 at 12:06 AM

Pretty hard to say. But possible things are;

- files (could you copy in what you've got in your theme?)

- Errors in drivers or shape modification code that are anything to do with BlogPost, List, Blog

- Changes to other templates preventing that file being rendered

I think your best bet is in your clean install, add the themes and modules one at a time from your other instance. Test after each one.

If you add all the themes and modules without triggering the problem, that leaves two options:

- Changes to core modules (which you could have made by accident, for instance it's very easy to edit the wrong file since they're all named the same)

- Or ... could be a bug where something in a database record is making a particular driver or shape event fall over; for instance an empty field that shouldn't be, or a particular combination of characters in a post. To diagnose this you could export all the blog data from your broken site and import it to the clean version.

Apr 18, 2011 at 3:31 AM
It is very frustrating that everytime something goes wrong in the CMS I need to start fresh and re-add everything. This is like the third time.

Is there an entry point I can start with and follow it through and see where it is breaking?



Apr 18, 2011 at 3:45 AM

Well ... you shouldn't need to, it just seems like there's a bug in one of the modules or themes you're using. Maybe one of the modules is messing up the database somehow. Exactly which ones are you using?

Apr 18, 2011 at 3:56 AM

I Disabled all of those and tried the blog, and nothing. I removed my file, nothing.

It looks like the BlogDescription View fired, but not the list.



Apr 18, 2011 at 4:51 AM
Edited Apr 18, 2011 at 4:51 AM

One of those things has to be causing it. We need to found out which one.

So let's go thru this step by step;

- Create a new Orchard instance

- Add some blog posts

- Add the DateTimeField module

- Are the blog posts still showing?

- Add the AdvancedMenu module

- Are the blog posts still showing?

- etc.

At the point when the blog posts stop showing, you have found the module that's causing it. It's the easiest way to narrow down the problem (without having to start debugging thru Orchard source code).

Without knowing which module is causing it, there's no way I can help unfortunately!

Apr 18, 2011 at 1:39 PM
Looks like it occurs when I swap the DB out. I am upgrading to VS2010 SP1 now to be able to connect to the DB and see what is going on in there as compared to the clean version.



Apr 18, 2011 at 2:00 PM

Sorry I'm not sure exactly what you mean by "swap the DB out"...?

Apr 18, 2011 at 2:05 PM
After moving modules and my theme in to the clean install to see which one was causing the issue, it was not until I moved my database into the new install that the blog stopped working.



Apr 18, 2011 at 2:17 PM
Edited Apr 18, 2011 at 2:17 PM

Ok, so it's definitely something in the database; but that could mean a lot of things.

Have you tried Import/Export to transfer the content into the clean database, instead of just moving the whole database over?

However ... I was noticing a kind of similar issue last night when I was updating my website to 1.1 and adding content. Some content items where Container / Containable had been involved were displaying blank. So I think there's a bug that causes certain routing situations to go awry. Are you using the Container or Containable parts on either your Blog or Blog Posts?

Apr 18, 2011 at 2:42 PM
The blog natively does not use Container/Containable parts. I verified this first because I thought perhaps somehow the Blog Content Type lost "Container" and Blog Post lost "Containable".

I will try and look at the DB and see what the issue might be. I am going to compare the blog entries to that of the clean install. Hopefully there is something obvious.



Apr 18, 2011 at 3:53 PM

Yes I know this; I was just wondering if you'd added Container to Blog (which would mean you can put the Blog itself in a List)

However under the surface, Blogs and BlogPosts use some of the same mechanisms as Container/Containable, even if they don't have those parts.

At this point I'm suspecting something's going on with RoutablePart, which is a common factor in both cases; and relating to the handling of nested Urls.

I'm going to try and find a reproduction of the issues I saw last night. Problem is, it seemed pretty random so it could be hard to nail down.

Apr 18, 2011 at 5:49 PM

I've created a workitem for this:

Problem reproduced both locally and on production server.

Doing some debugging now to find out more about what's happening...

Apr 18, 2011 at 6:19 PM

@arock3: would you mind zipping up the site and sending it to me at bleroy at microsoft? I'll have a look and try to see what's wrong.

Apr 18, 2011 at 6:33 PM

Hmm ... had another go and this time the reproduction didn't work immediately. It's really very random. The Test2 page worked fine ... then I created a Test3 and also added it to the original Test page and suddenly Test2 and Test3 went blank. I think if you spend enough time creating pages and adding them to lists, each time checking whether you can see the content, eventually you'll hit the problem.

BTW; this is all on SQL 2008 Express R2, will attempt to reproduce it on SQL CE now.

Apr 18, 2011 at 6:35 PM

We need to get to the bottom of this. Next time it happens, can you send me your site in the state where it fails?

Apr 18, 2011 at 6:56 PM
I apologize guys I am away from my comp until later on. Thanks for chasing this down.

Sent from my iPhone so message may be brief.
Apr 18, 2011 at 7:45 PM

Blogs have their own route since the Orchard.Blogs module still has yet to make full use of containers. Setting a breakpoint in the BlogController’s Item action should (hopefully) shed a little light on the problem. If it doesn’t get hit then that’s one problem...

Apr 19, 2011 at 12:42 AM
So I think I stumbled upon the problem by accident.

I tried to add a new blog to the CMS to test out what info gets seeded in the DB when a new blog is created. I noticed this new blog worked on my existing site. This was strange to me since everything was broken prior. I noticed when I created the new blog I didn't bother to set the Permalink for the blog.

The link /test-blog rendered all the blog posts. But when I modified the URL to /about-us/test-blog the posts were not generated. It must be something related to the routing of the folders.

Could someone with a little more knowledge shed some light on this?



Apr 19, 2011 at 12:43 AM
Bertrand I don't want to send the site as it is a customers site. I just posted some reproduction steps that I think will help.

Let me know if it helps.



Apr 19, 2011 at 12:47 AM

Right: '/' in a blog slug won't work.

Apr 19, 2011 at 12:49 AM
Haha oh jeez. Thanks everyone for chasing this down with me. I really appreciate it.



Aug 7, 2011 at 10:39 PM

I am running into problems with blogs as well.  I have the latest download of source downloaded 8/1/2011.  I am running locally from VS2010 right now.

What I see on a blog page:

What I see when I click on the Archive link in at the bottom of the page:

My blog properties:

I am not finding anywhere to set the blog slug (not exactly sure what a slug is!).

What further info can I send?

I am using SQL 2008 R2 on my dev machine.

Aug 8, 2011 at 5:50 PM

Your blog location needs to be  at the first level of navigation. You can't have a blog below that there is a bug. So just move it so it sits at instead of

Aug 8, 2011 at 8:30 PM

Yes, lose the slash in the blog's permalink.

Aug 18, 2011 at 11:44 AM

Is there a workaround to fix this? Our customer has multiple blogs(...), and wish to see them in a list. So i added the containable part to the blog content type, but from there the slash part is inevitable it seems due to the list.



Aug 18, 2011 at 7:04 PM

What you can do actually is using the Recent Content module from the gallery, and select Blog Post as a filter. It will get all blog posts whatever container it has. It's a Widget though, so you might want to create your own module, and create a new type named Blog Aggregate which would let you select a set of blogs and act as a list for them. It depends on how far you want to go with coding.

We are also working on a new feature which would let you query stuff like that without coding, but we can't give any ETA ...