Dec 30, 2012 at 11:02 PM
Edited Dec 31, 2012 at 5:16 AM
|
I'm trying to understand injecting shape templates a little better.
I've seen several examples of injecting ad hoc shapes, but I'm still fuzzy about a few things.
So, from the Theme Machine theme, there is this line:
WorkContext.Layout.Footer.Add(New.BadgeOfHonor(), "5");
It creates an ad hoc BadgeOfHonor shape template. This makes sense because elsewhere in the theme there is a BadgeOfHonor.cshtml view.
However, in the same layout, there is this line:
WorkContext.Layout.User.Add(New.User(), "10");
There is no User.cshtml so it's getting it some other way (from Core/Shapes I presume). How does it know where to get it?
What got me wondering how this works is that I'm trying to inject the view for the QuickLogOn module. I've tried:
WorkContext.Layout.User.Add(New.QuickLogOnWidget(),"15");
I thought this might work given that there's a part called QuickLogOnWidget.cshtml defined in the module. No luck though. Gives a "Shape type QuickLogOnWidget not found". I've even defined a Part.QuickLogOnWidget.cshtml in my theme hoping that
it would work, but no love there either.
I figured that if I knew more about how creating ad hoc shape templates work, I could figure out how to load the QuickLogOnWidget.
Any ideas?
|