Question

I am making my own theme using Bootstrap theme from Orchard dashboard as the base theme. When I run the site using my theme(in which I have not made any changes, it is just a simple copy of bootstrap), it is giving me error : object not set to an instance of an object. In Views/User.cshtml file : var swatch = WorkContext.HttpContext.Items[Constants.UseSwatchName].ToString(); on this line.

I also tried changing all the namespace from Bootstrap to the name of my new theme, this also dint work out. Please suggest

Was it helpful?

Solution

I reported this as an issue to Philip Senechal, the guy who made the theme, here: https://github.com/psenechal/Bootstrap/issues/13 He reportedly has fixed these issues in the latest version of the source, so if you grab that it should work, although I haven't tested it.

I think I fixed it by just commenting out his use of swatch stuff, but I would recommend grabbing the latest version from GitHub: https://github.com/psenechal/Bootstrap

OTHER TIPS

I just came across this same issue whilst copying the latest version (3.0.0.2) of the Wiggleware Bootstrap theme.

I resolved the issue by changing every single Bootstrap namespace reference to my new namespace from the Bootstrap namespace. If you don't catch every single one it won't work.

Here are the list of actions I used to get it to work (not all might be necessary):

  • Copied theme to a folder named "MyTheme"
  • Changed theme name to "MyTheme"
  • Changed all "using Boostrap*" statements to "using MyTheme*"
  • Change all "namespace Bootstrap" occurrences to "namespace MyTheme"
  • In Constants.cs changed RoutesAreaName, ThemeDir and ThemeName values to "MyTheme"
  • Change all code references (in AdminMenu.cs, AdminController.cs, CommentGravatar.cshtml) from Bootstrap.* to MyTheme.* (or you can simply chop out the Bootstrap part as it is redundant)
  • Renamed Bootstrap.csproj to MyTheme.csproj and changed RootNamespace and Assembly name within that file from Bootstrap to MyTheme
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top