Blog


Taiming the beast

Published: 2/11/2015, Author: Håkan Edling

I've been putting a lot of effort into the experimental vNext platform lately, but that doesn't mean that the good old Piranha isn't getting any love. Right now I'm focusing on Enity Framework, and I'd like to share why.

One of the drawbacks with the current architecture has for the last years been the data layer. It was originally written before Entity Framework code first was released, and has been slightly patched since then to keep up. The database has been created, and updated with raw SQL and this, together with multiple data mappings has complicated for people interested in collaborating on new features. With the next version I'm taking a first step to remedy this.

0 Comments

Read more


Listing images located in a specific folder

Published: 10/10/2014, Author: Håkan Edling

An easy way to build image archives is to use folders as a base. This way the content administrator can easily upload images into a specific folder and be confident in that they will show up in the correct place.

The first thing to decide is if you're going to locate the folder by it's name, or simply hardcode it somewhere. If you want to find the folder by name you have to be aware that folder names doesn't have to be unique, so there's always a risk of getting multiple results back.

0 Comments

Read more


Love your users, not your product

Published: 3/11/2014, Author: Håkan Edling

Instead of just talking about the planned 3.0 release of Piranha CMS I'd like to step back and talk about the product lifecycle, how past choices affect the present and try to give a clear roadmap on the future of Piranha CMS.

I'll admit it, I'm a startup person. I'm the guy that thrives on new challenges and who loves setting the fundament and architecture for new projects. The reason for this is simple - it's in the beginning of a project that you can evalute everything you've learned and all that's happened to technology up to that point. Once you get started the scope is set, and you have to accept to play within the given rules, even if you've set them yourself.

0 Comments

Read more


Pre-release of 2.2.0

Published: 1/29/2014, Author: Håkan Edling

There's now a pre-release of 2.2.0 available at NuGet for those who wants to try out Piranha CMS with ASP.NET MVC 5.1 & EF 6

For those who have been waiting to run Piranha CMS with ASP.NET MVC 5 we're happy to announce that we've released a pre-release of version 2.2.0 on NuGet. This version is exactly the same as 2.1.6 except for that all NuGet-packages have been updated to the latest version.

0 Comments

Read more


What's coming in version 3.0

Published: 1/8/2014, Author: Håkan Edling

It's been quiet for a while, the reason being that I've been working like a mad man trying to get the core for the upcoming 3.0 release done. So here's a quick walkthrough of some of what's coming.

Please note that this blog-post was written over a year ago and is really outdated. Since then a lot of discussions have been made regarding the new version of Piranha CMS and what it should contain. If you want contribute to the process, please take time to visit the repository for the new version at github.com/piranhacms/piranha.vnext.

0 Comments

Read more


Installing Piranha CMS with NuGet 2.7

Published: 9/3/2013, Author: Håkan Edling, Categories: Piranha, .NET

After the recent update of NuGet to version 2.7 there seem to be some issues when creating a fresh install of Piranha CMS. Luckily there's a fairly simple workaround for this issue.

The package Piranha.Core is dependent on the ASP.NET MVC package from NuGet and when installing this package with previous versions of NuGet the runtime assembly versions are added to the Web.config. After the latest upgrade this section seems to be missing even though no updates have been made to any dependent packages. This causes exceptions when starting the application as the runtime don't know which assemblies to load.

0 Comments

Read more


Keeping composite pages up to date

Published: 8/19/2013, Author: Håkan Edling, Categories: .NET, Piranha, Tutorials

A problem in almost all systems when dealing with caching and composite pages is to invalidate the cache for a page when a related entity is update. In this post we'll look at how you could handle this manually in Piranha CMS.

In Piranha CMS all pages are cached server side, as well as leveraging browser cache on the client side. This is of course to minimize the processing needed and to keep the site as fast and efficient as possible. When a page is updated in the manager interface the page_last_published date is updated and the server cache for that particular page is invalidated causing all subsequent request to get the latest version of the page.

0 Comments

Read more


The magic of routing with multiple areas

Published: 4/5/2013, Author: Håkan Edling, Categories: .NET, Programming

Routing in ASP.NET MVC is pretty straight forward, however, with multiple areas and the strong possibility of having controllers with the same name in several of them strange things can happen.

In our current work with getting Piranha CMS for to play nice with MVC applications we ran into some issues with the routing and area setup. Before, when hosting the core framework in a Razor website one could be pretty sure that the manager controllers would be the only controllers around, but with a MVC application this would of course not be the case.

0 Comments

Read more


Versioning & source management

Published: 3/24/2013, Author: Håkan Edling, Categories: Piranha

With the release of version 1.2.0 it's time to embrace the fact that Piranha CMS has grown in functionality and compexity to a level we didn't foresee in our initial release.

With this in mind it's time to take a look at how we will be working with the versioning and the structure of our GitHub repo from now on.

0 Comments

Read more


Image & html extensions

Published: 3/18/2013, Author: Håkan Edling, Categories: Piranha, Tutorials

When you're building page types you can define regions different types, the two most common being Html content and Images. But what if you wan't to attach these kind of content to another entity.

As we always claim that Piranha is an extensible and open framework we'll give a short example on how you can extend two of the standard regions of the framework and apply it to another entity. In this example we'll add html-content and an image to the category as we wish to present them in a nice way on our web page.

0 Comments

Read more


Running Piranha on MySql

Published: 10/24/2012, Author: Håkan Edling, Categories: Piranha

Even though SQLServer is the common standard when deploying .NET applications, sometimes when developing for a shared hosting environment MySql is preferable as it's often cheaper and more widely available.

With this in mind we've decided to add support for running Piranha on MySql in the upcoming 1.1.2 version. By implementing this functionality we also hope that we're opening up the door for developers wanting to run and deploy a Piranha application in a Mono environment on a non Microsoft OS. In this post we'll show how to configure your Piranha application for MySql.

0 Comments

Read more


License update

Published: 8/16/2012, Author: Håkan Edling, Categories: Piranha

In order to ensure that all future forks and derivate work of the core library remains open source we have changed the license from Apache 2.0 to LGPL.

The license for the three core libraries Piranha, Piranha.Entities and Piranha.Globalization has been updated from Apache 2.0 to LGPL. This is to ensure that all future forks and derivate work based on these libraries remain open source for you to access. Note that the template project itself distributed through NuGet is not licensed with LGPL.

0 Comments

Read more


Working with the Piranha menu

Published: 7/6/2012, Author: Håkan Edling, Categories: Tutorials, Piranha

When it comes to building menus, Piranha really makes it easy for you. In this post we'll describe how the included menu works and how you can tweak it to your needs.

Unlike many other CMS platforms out there Piranha really makes it easy for you to build menus. With just a single helper method it provides you with a number of choices for creating the menu structure you want, without any fuzz. And even better, the menu is rendered as a simple UL/LI list with no unneccessary HTML to clog up your neatly constructed layout.

0 Comments

Read more


Customizing the html-editor

Published: 7/6/2012, Author: Håkan Edling, Categories: Piranha, Tutorials

When you login to the manager interface for the first time you might think that the html-editor is a bit sparse on the tools it provides. But don't worry, like everything else, the editor can be changed and customized for you applications.

After you create you Piranha website you might notice that there is a folder named Areas included in the site. Below this folder you'll find the Manager area with it's Content & Views folder. The entire manager interface is based on using a virtual path provider for retrieving the manager content that's embedded inside the core Piranha dll. However, this provider always look for the corresponding file on the local filesystem first, which means that all views and resources provided as embedded resources can be overriden or changed in the project.

0 Comments

Read more


Refactoring the archive page

Published: 7/5/2012, Author: Håkan Edling, Categories: Piranha, Tutorials

In this post we'll take the Blog archive page we built in the last post and refactor it by moving the inline code into a custom model and then finally creating a new page implementation.

Before we go any further and start refactoring our archive page, make sure you read the previous post where we created the archive page.

0 Comments

Read more


Implementing a blog/archive page

Published: 7/4/2012, Author: Håkan Edling, Categories: Tutorials, Piranha

In this post we'll look at how to implement a startpage for a blog with archive functionality with Piranha. We'll start off by implementing this functionality only with inline page code, and in the next article we will continue by refactoring it by moving the code into a custom page implementation and extend the basic PageModel.

Almost every site need some kind of archive functionality, weather it's a blog or a news archive. Luckily for us, there's a lot of base functionality for this included in Piranha, and as an example we'll look at how we've implemented the blog page at this site.

0 Comments

Read more


Supporting precompiled websites

Published: 6/20/2012, Author: Håkan Edling, Categories: .NET, Programming

In most cases deploying your website precompiled doesn't impose any problems. However, if you have a more complex structure utilizing virtual path providers you will soon run into a brick wall. So did we when trying to deploy a site yesterday.

Yesterday, when configuring a Piranha site to be deployed at City Network we ran into a classic problem. The hosting provider had decided only to support precompiled websites without just in time compilation. Of course, getting the site precompiled is only a matter of how you deploy it, but as always there's always the odd chance of something breaking.

0 Comments

Read more