Latest Event Updates

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

Slider, slideshow, slide and scroll

Posted on

Fallback ustrzegający przed null string

Posted on Updated on

<a href="@Url.PageUrl(Model.Url.ToString())">Link</a>
null object ToString
Press F10 and wait for bum

Poor workaround:

<a href="@Url.PageUrl((Model.Url ?? "").ToString())">Link</a>

The best would be to create Extensions Method PageUrl(Episerver.Url url) taking Url as parameter and performing null check (or fallback).


There is already extension that do this, but strangly in another class:

@Html.UrlLink(Model.Url, "Link")

Episerver 7: The INSERT statement conflicted with the FOREIGN KEY …

Posted on Updated on

The INSERT statement conflicted with the FOREIGN KEY constraint “FK_tblWorkContentProperty_tblPropertyDefinition”. The conflict occurred in database “EPiServer”, table “dbo.tblPropertyDefinition”, column ‘pkID

TLDR; iisreset
I used to regerate guid for a page, but it was of course dumn and worked will I get better solution.

Nagrywanie screencastów – Camtasia

Posted on

Prosty darmowy, działa.

Wyrażenia regularne w C# (Replace)

Posted on

public class CustomHtmlTagsEncoder
    public string Encode(string text)
        string encoded = HttpUtility.HtmlEncode(text);

        var regex = new Regex(@"&lt;(\s*br\s*/?\s*)&gt;", RegexOptions.IgnoreCase);

        var decodedBr = regex.Replace(encoded, "<$1>");

        return decodedBr;

Najciekawszy moment to regex.Replace(text, “$1“);
Za pomocą $ możemy wpisywać sekwencje które wcześniej zostały złapane za pomoca nawiasów. $0 oznacza cały dopasowany string, w powyższym przypadku byłoby to razem z ‘&lt ;…’

Jira hours separator

Posted on Updated on

It is . (dot)