Layout and completion/Dynamic

Topics: Core
Oct 4, 2012 at 1:02 PM
Edited Oct 4, 2012 at 1:09 PM

Hi,

I notice in the layout.cshtml, I find the line 

WorkContext.Layout.Header.Add(New.Branding(), "5"); // Site name and link to the home page

So to try to understand, which are the parameters, I try to find the method Add for the Header.

So I press 12.

So I try the class WorkContext, an abstract class C:\Orchard\src\Orchard\WorkContext.cs

Layout public new dynamic Layout { get { return _layout; } } in C:\Orchard\src\Orchard\Mvc\ViewEngines\Razor\WebViewPage.cs

So after Layout everything is dynamic. how can I understand clearly what I can use or put.

I rode many things on some library/concept as  castle project, clay and Dynamic used in Orchard. But to be honest, it is a little bit difficult :)

How do you proceed to understand how each elements works? My assumption is I need to put a break point an learn, dynamic doesn't permit to understand in other manners, so the time to knowledge can be long.

Example

- Layout {IShapeProxy60c0e098c877477391a0a20d8bf297aa} dynamic {IShapeProxy60c0e098c877477391a0a20d8bf297aa}+ __interceptors {Castle.Core.Interceptor.IInterceptor[1]} Castle.Core.Interceptor.IInterceptor[]+ __target {ShapeProxya9ebb9a24c3b4cc0a553008f7da88437} object {ShapeProxya9ebb9a24c3b4cc0a553008f7da88437}+ Metadata {Orchard.DisplayManagement.Shapes.ShapeMetadata} Orchard.DisplayManagement.Shapes.ShapeMetadata- Dynamic View Expanding the Dynamic View will get the dynamic members for the object Empty "No further information on this object could be discovered" string

I should go inside Layout and after that memorize with class is used"Orchard.DisplayManagement.Shapes.ShapeMetadata".

Do you have another best way to understand how orchard works (more quick :)) (I already rode the documentation on the website :))

Best regards,

Alexandre

Oct 4, 2012 at 4:09 PM

Hi,

Finally,  I have another question.

I search where the real object is really loaded.

I mean in AccountController, I can notice _authentificationService is used.

In fact in background, it's FormsAuthenticationService.

[AlwaysAccessible]
        public ActionResult LogOn() {
            if (_authenticationService.GetAuthenticatedUser() != null)
                return Redirect("~/");

Where in the code, is defined to load FormsAuthenticationService, CastleProject/autofac needs to know that (I think you use C:\Orchard\src\Orchard\Environment\AutofacUtil\DynamicProxy2\DynamicProxyContext.cs) nevertheless where can I find it's FormsAuthenticationService choosen.

Best regards,

Alexandre

Developer
Oct 6, 2012 at 5:26 AM

These posts might be helpful:

http://downplay.co.uk/tutorials/clay/down-the-rabbit-hole
http://downplay.co.uk/tutorials/clay/part-2-through-the-looking-glass

If you have ReSharper installed, you can right-click on any interface and choose "Go to Implementation". Highly recommended tool.

Oct 9, 2012 at 7:29 AM
Edited Oct 9, 2012 at 7:30 AM

Hi,

Thank you for your reply.

Very good article. It permits to go more deeper inside Orchard.

is there any place/thread where copy past  this kind of link?

On my side I use a simple word to manage the grabbed links.

Best regards,

Alexandre

PS: I can't use Resharper it's not a free tool.

Oct 9, 2012 at 10:37 AM

Resharper offers a 30 trial which should trace you thru quite a few of Orchards rabbit holes.

Developer
Oct 23, 2012 at 11:46 PM
ddoc wrote:

is there any place/thread where copy past  this kind of link?

 


The one place I know of that contains links to all of the great Orchard blog posts out there are on orchardproject.net. Read everything you find there and you're set.