You're welcome! Please be aware that after releasing the package, I ran the MiniProfiler for Umbraco and I discovered some performance issues which I explain here http://jlusar.es/profiling-ubootstrap. If you want to get the 'fast' razor views, you can grab it from Github. I'm planning to release a new package in about a month with the enhanced razor views and Twitter Bootstrap 2.1 if available.
Error loading MacroEngine script
Getting several load errors on a clean install on v4.7.2 - any thoughts?
Hi Bob,
The uBootstrap version v1.1.0 is only compatible with Umbraco 4.8.0.
Thanks,
Jorge
and that would explain it! thanks Jorge! i will install 4.8 and give it a whirl!
You're welcome! Please be aware that after releasing the package, I ran the MiniProfiler for Umbraco and I discovered some performance issues which I explain here http://jlusar.es/profiling-ubootstrap. If you want to get the 'fast' razor views, you can grab it from Github. I'm planning to release a new package in about a month with the enhanced razor views and Twitter Bootstrap 2.1 if available.
Cheers,
J
Hello Jorge,
Thanks for the "fast" razor view (and the miniprofiler !! it's great)
Just for info, here is the way I would write the Navigation.cshtm. I use DynamicNode (not dynamic ;) and GetChildrenAsList.Items.Where(xxx)
In this case I don't have to get all children as an Array and do a filter afterwards.
Of course I use GetChildrenAsList if I only need the first level children, otherwise I use GetDescendant
PS : I didn't notice any performance improvement with my code throught...
@using umbraco.MacroEngines
@inherits umbraco.MacroEngines.DynamicNodeContext
@{
DynamicNode root = Model.AncestorOrSelf("Homepage");
<ul class="nav">
@{ var homeSelected = @Model.Level == 1 ? " class=\"active\"" : string.Empty; }
<[email protected](homeSelected)><a href="@root.Url">@root.Name</a></li>
@foreach (DynamicNode item in root.GetChildrenAsList.Items.Where(x => x.GetPropertyValue("UmbracoNaviHide") != "1"))
{
var selected = Array.IndexOf(Model.Path.Split(','), item.Id.ToString()) >= 0 ? " class=\"active\"" : string.Empty;
List<DynamicNode> listChildren = item.GetChildrenAsList.Items.Where(x => x.NodeTypeAlias == "Textpage").ToList();
if (listChildren.Count() > 0)
{
<li class="dropdown">
<a href="@item.Url" class="dropdown-toggle" data-toggle="dropdown">@item.Name</a>
<ul class="dropdown-menu">
@foreach (DynamicNode subItem in listChildren)
{
<li><a href="@subItem.Url">@subItem.Name</a></li>
}
</ul>
</li>
}
else
{
<[email protected](selected)><a href="@item.Url">@item.Name</a></li>
}
}
</ul>
}
Hi Fabrice,
Thanks for letting me know! Yes, using DynamicNode definetely helps as you get also intellisense in Visual Studio as well. Anyway, if you are having some perfomance issues with your razor view, I'd suggest to vote on http://umbraco.codeplex.com/workitem/30745 and/or post it on the https://groups.google.com/forum/#!topic/umbraco-dev/ZzP2L0c_znA%5B1-25%5D
Cheers,
Jorge
is working on a reply...