Month: September 2013

Then OnPageEdit is missing

Posted on

Episerver has a helper method @Html.DisplayFor(m => m.MainIntro) which basically writes MainIntro in ViewMode and make editable green rectangle in EditMode (OnPageEdit). But not always it works and I don’t know why. Below are some tricks to force it to render blue (green when hoovering) rectangle while in OnPageEdit. First is just string, second is ContentArea.

    <div class="intro" @Html.EditAttributes(m => m.CurrentPage.MainIntro)>
        @Html.PropertyFor(m => m.CurrentPage.MainIntro)

onPageEdit episerver 7

There is @Html.DisplayFor here

    if (PageEditing.PageIsInEditMode)
        <div class="footer-partners">
           @Html.DisplayFor(m => m.Footer, new { CssClass = "footer-partners", EditContainerClass = "footer-partners" })
       @Html.DisplayFor(m => m.Footer, new { CssClass = "footer-partners", EditContainerClass = "footer-partners" })

I am using EditContainerClass like in the post How EPiServer’s HTML helper PropertyFor works. Maybe on my pages there is something wrong in the markup in other places and we don’t have time to investigate? I am just Back End developer and this tricks helped me 🙂


Posted on

jira epics in plan

• Zapomniałem jak się robi to ze Sprint1, Plan i idziemy na dół po levej i przesuwamy do Sprint1. Idziemy najpierw na Epic, a później create issue w Epic i przesuwamy do Sprintx.

Co rzucić z kodu aby otrzymać 404 (MVC)

Posted on

throw new HttpException(404, “Some description”)

Coś tam po drodze może się zdażyć więc oryginał:

Passing data to built-in framework properties

Posted on

You will need to override the default rendering of i.e. LinkItemCollection

@Html.PropertyFor(x => x.Links, new { @class="nav nav-tabs"})
@using EPiServer.SpecializedProperties
@model LinkItemCollection
<ul class="@ViewData["class"]">
    @foreach(var linkItem in Model ?? Enumerable.Empty<LinkItem>())
        <li class="@ViewData["itemClass"]">@Html.PageLink(linkItem)</li>

GenericListProperty is too low EditMode

Posted on

too low GenericListProperty

It takes only 30% of height.

Workaround is too close it and open again – then it would have full height. It stays correct when you are editing many pages and gets reset when make full refresh.

GenericListProperty empty list in View Mode

Posted on

I am using OpenWaves.EPiServer.GenericListProperty.

I had a problem when my list was populated in EditMode but was always empty in ViewMode.
Two solutions:

  1. You add two lines to episerver.config

  2. Remove properties from code, compile, remove from AdminMode, add again and should work.

I prefer the first one.

Resharper 8 find your view in MVC

Posted on Updated on

Resharper 8 has some new stuff:

  • You don’t have to enter Ctrl+Shift+N to get search for all files. Ctrl+N is enough. No distinction like in R#7
  • You don’t need to write camels: ArtP to search for ArticlePage, now you just write ‘anything’ like ‘arpa’ and it feets ArticlePage.
  • Finding your view is much easier. To find you Index.html for corresponding ArticlePage you can write ‘arpa.csh’.
  • anything you type looks as well for directories (path)
    resharper finds by directory tree

The drawback is that you have more things to deal in this small window. However it is not a big deal 🙂

[ReflectionTypeLoadException: Unable to load one or more of the requested types

Posted on

[ReflectionTypeLoadException: Unable to load one or more of the requested types. The following information may be a subset of the Type/LoaderException information present – inspect with debugger for complete view.
Check assemblies [OpenWaves.EPiServer.GenericListProperty, Version=, Culture=neutral, PublicKeyToken=7d0a8c4a744cf5c7] and/or types [OpenWaves.EPiServer.GenericListProperty.FakeContent, (bla bla bla)

Przykładowe rozwiązanie:
W jednym projekcie zależę od bibliotek w wersji x.y.z, a w innym projekcie, tym z którego startuje aplikacja (Web) jest w wersji x.y.y

Start project from Alloy

Posted on Updated on

Next project I would have to start in Epi7 MVC (and will be responsible for this) would just plain Alloy Templates solution. From there start adding new pages/blocks/etc.

I would leave Alloy pages and blocks for same time so the knowledge (common within Epi world, so its good to stick to it) about creating good blocks/pages will be spread among team. By this I mean naming, organizing in directories, reusing the exact same classes.

Concepts that you have to use, time saver all the time in all contexts (maybe too much said, but it is my current experience):

  • SiteViewEngine
  • SiteImageUrl

Things that can be removed:

  • Content Area renderers – probably its too narrow and detailed