Dinamico Templates (Process recycle) details are not displayed

Topics: Developer Forum
Jul 17, 2012 at 11:01 PM
Edited Jul 19, 2012 at 6:12 PM

I'm using template first. I have following template. Every time the process restarts the following view is not displaying "Text" [@Content.Display.Text]. If I edit one content item and publish it then everything shows up correctly on the website until when IIS recycles the process after some idle time.

Content.Define(re =>
                       {
                           re.Title = "Generic Page";
                           re.Text("SubTitle", "Sub Title");
                           re.FreeText("TextDesc");
                           re.RestrictParents("GenericContainer");
                           re.RestrictChildren("All");
                       });
<article>
        <h1>@Content.Data.Title</h1>
        <!-- info -->
        <div class="info">
            <div class="info-text">

               @if (Content.Has.SubTitle)
              {
                <h4>@Content.Data.SubTitle</h4>
              }
                @Content.Display.TextDesc
                <br>
                <br>
            </div>
        </div>
   </article>
Coordinator
Jul 18, 2012 at 10:48 PM

Interesting, I'll see if I can reproduce

Jul 19, 2012 at 6:14 PM

Libardo, thanks for responding. This is only happening when I use Display Helper. Also changed the property from "Text" to TextDesc to avoid confusion. I'm using N2 2.2.6 version.

Jul 19, 2012 at 8:36 PM

Calling the following statement fixed it. 

Content.Engine.Definitions.GetTemplates(typeof(ContentPage));

Still figuring out what is the best place to call it. Tried calling it in GlobalMvcStarter but did not work in all projects so currently calling it in StartPage/Index.cshtml.

 

 

Coordinator
Jul 19, 2012 at 10:34 PM

I think I've found the issue and there's a fix:

https://github.com/n2cms/n2cms/commit/f3bbbff5455b2ed596d166d473d9f1431c113e89