This project is read-only.


Templates don't seem to work anymore


Shame on someone ... probably me :/

Repro steps:
  • Setup default recipe using SQL SERVER
  • Enable Templates
  • Create a new template
Expected result:
  • it should work
Actual result:
  • doesn't work


BertrandLeRoy wrote Mar 23, 2014 at 8:51 PM

Can you provide a repro? How does it not work? What have you tried, what were you expecting, and what did you observe instead? ;)

sebastienros wrote Mar 25, 2014 at 7:13 PM

** Closed by sebastienros 03/25/2014 11:13AM

agriffard wrote Mar 26, 2014 at 1:03 PM

If this line is commented in Orchard.Templates\Handlers\ShapePartHandler.cs, the Create works :
OnCreated<ShapePart>((ctx, part) => signals.Trigger(DefaultTemplateService.TemplatesSignal))

It is still working if instead you use :
OnPublished<ShapePart>((ctx, part) => signals.Trigger(DefaultTemplateService.TemplatesSignal))

Piedone wrote Mar 26, 2014 at 3:27 PM

Even with OnPublished I get the same timeout error.

Piedone wrote Mar 26, 2014 at 4:20 PM

No, I was wrong, what Antoine has written indeed fixes the issue.

sebastienros wrote Mar 26, 2014 at 5:46 PM

I am going with a different code path, not using TemplateProviders anymore, and removing the razor specific code from the core. This looks nicer to me and should also fix some broken unit tests. Thanks for looking into this.

sebastienros wrote Mar 26, 2014 at 8:21 PM

Fixed in changeset 35d2a6c8fd5e321eef78efd12b93ec2b5971fe68

jindaming wrote Apr 16, 2014 at 7:32 AM

Can you explain what is the reason for this issue?
I could not make it work after download the new 1.8 version.
I found that the content part was not rendered at all.
so I modified the driver to add the following code and empty view,
protected override DriverResult Display(ShapePart part, string displayType, dynamic shapeHelper)
        return ContentShape("Parts_Shape",
                            () =>
                                return shapeHelper.Parts_Shape();
then I modified the event handler code to ,
if (context.ShapeMetadata.Type == "Parts_Shape")
            if (processors.TryGetValue(context.Shape.ContentPart.Name, out processor))
                context.ChildContent = processor(context.Shape);
It seems to start to work but I still do not understand what is the issue?