MonthJune 2015

Umbraco custom section name – How to remove square brackets

After configuring the custom section with help of IApplication interface in Umbraco, you must have faced issue with custom section name decorated with square brackets. This issue occurs due to the translations (language) being missing in config file for custom section name.

Problem – Remove square brackets from custom section name-

Soultion – Goto Umbraco\Config\Lang folder in your umbraco project

In en.xml file, under sections area – add key with alias magic and provide a relevant name as shown below-

Done square brackets are removed and replaced with custom description. Check out-

Installing Umbraco 7+ in visual studio 2012/2013

How to install Umbraco 7+ in visual studio 2012/13 using nuget package

1. Create a blank Web application using visual studio

2. Open package manager console. Select appropriate project(web application) and hit command Install-Package UmbracoCms -Version 7.2.6At the time of writing this post Umbraco 7.2.6 was the latest version.Refer –

3. Done- Umbraco is installed. All binaries and config files are automatically included in project.

4. Run web application and Umbraco site setup details are asked.

Nullable type issue with ?: Conditional Operator

Consider if you want to use if and only if condition (IIF) with a nullable type

DateTime? foo;
foo = true ? null : new DateTime(0);

This will throw a compiler error. To resolve this cast null to nullable type as below-

foo = true ? (DateTime?)null : new DateTime(0);

List of LINQ syntax for immediate execution

These are some of the LINQ syntax for immediate query execution (more to add)-
1. ToList()

2. FirstOrDefault

3. Aggregate Methods (like Count(), Sum() etc.)

4. AsEnumerable()

As I said there are more to add, will keep updating as and when I find more methods.

Happy Coding!!!

SQL Connection error: Reverse engineering Code First using Entity Framework

Following error is received whilst reverse engineering code first using entity framework-

To resolve this issue in Connection Properties –> Advanced option –> select Persist Security Info to True

Adding Custom section in Umbraco 7+

To add a custom section in Umbraco add following class to your VS Umbraco Solution- [Application(“Magic”,”magic”,”icon-people”,10)] public class Section : IApplication{}
Use following namespace-using umbraco.businesslogic;using umbraco.interfaces;using Umbraco.Web.Mvc;
Refere following Umbraco dll’s-

  • businesslogic.dll
  • intefaces.dll
  • umbraco.dll

Dont forget to provide admin user access to the newly added section

Screenshot below -

Please note the first time you run app after making this change Umbraco will update application.config file. So you might consider to close the application and run again to reflect the change.
application.config file is located in Config folder.

Unfortunately I am not able to remove square brackets [Magic] in custom section, as soon as I know it will share with you,
Also will shortly share how to configure Umbraco in VS2013.

© 2021 Sandeep Pote

Theme by Anders NorénUp ↑