Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Greg 6 posts 27 karma points
    Feb 20, 2013 @ 01:36
    Greg
    0

    Umbraco 6 coupled with uBootstrap

    I have created a fresh install of Umbraco 6 and installed uBootstrap as my starter package.  After the fresh install and viewing the pages, I see 'Error loading MacroEngine script' in each macro location.  

    This led me to think what else could possibly have conflicts with 6.  Has anyone successfully installed and used this package for Umbraco 6?  What potential issues could arise and can it be easily adapted?

    I'm starting a new project and am curious if I should take this route (Umbraco 6 + uBoostrap) to save time, or will it inevitably create more of a headache.

    Thanks!

    p.s. Great package by the way!

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Feb 20, 2013 @ 12:33
    Jeroen Breuer
    0

    Do you have some extra error info? Perhaps it's just 1 error which breaks all macro's.

    Jeroen

  • Greg 6 posts 27 karma points
    Feb 20, 2013 @ 19:32
    Greg
    0

    Haven't investigate much yet, but seems to revolve around parsing the navigation:

    Error loading MacroEngine script (file: Navigation.cshtml)

    Error loading MacroEngine script (file: SideNavigation.cshtml)

     

    Navigation.cshtml:
    @using umbraco.MacroEngines
    @inherits DynamicNodeContext
    @{
        var root = @Model.AncestorOrSelf();
        <ul class="nav">
        @{ var homeSelected = @Model.Level == 1 ? " class=\"active\"" : string.Empty; }
        <li @Html.Raw(homeSelected)><a href="@root.Url">@root.Name</a></li>
        @foreach (var item in root.Children.Where("Visible"))
        {
            var selected = Array.IndexOf(Model.Path.Split(','), item.Id.ToString()) >= 0 ? " class=\"active\"" : string.Empty;
            var subItems = item.Descendants("Textpage").Where("Visible");
            if (subItems.Count() > 0)
            {
                <li class="dropdown">
                <a href="@item.Url" class="dropdown-toggle" data-toggle="dropdown">@item.Name</a>
                <ul class="dropdown-menu">
                @foreach (var subItem in subItems)
                {
                    <li><a href="@subItem.Url">@subItem.Name</a></li>
                }
                </ul>
                </li>
            }
            else
            {
                <[email protected](selected)><a href="@item.Url">@item.Name</a></li>
            }
        }
        </ul>
    }
    
    
  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Feb 20, 2013 @ 19:55
    Jeroen Breuer
    0

    Umbraco 6 uses MVC 4 and that is stricter with Razor: http://issues.umbraco.org/issue/U4-1143#comment=67-4333

    In the code I see some @ characters which should be removed. For example at @Model.Level == 1 it's not allowed.

    Jeroen

  • Greg 6 posts 27 karma points
    Feb 20, 2013 @ 20:25
    Greg
    0

    Fixed it.  Thanks Jeroen. 

    This was mentioned twice in the code:

         <[email protected](homeSelected)>
    

    It needed a space between the 'li' and '@'.

    Here is the updated code:

    @using umbraco.MacroEngines
    @inherits DynamicNodeContext
    
    @{  var root = Model.AncestorOrSelf(); }
        <ul class="nav">
        @{ var homeSelected = Model.Level == 1 ? " class=\"active\"" : string.Empty; }
        <li @Html.Raw(homeSelected)><a href="@root.Url">@root.Name</a></li>
        @foreach (var item in root.Children.Where("Visible"))
        {
            var selected = Array.IndexOf(Model.Path.Split(','), item.Id.ToString()) >= 0 ? " class=\"active\"" : string.Empty;
            var subItems = item.Descendants("Textpage").Where("Visible");
            if (subItems.Count() > 0)
            {
                <li class="dropdown">
                <a href="@item.Url" class="dropdown-toggle" data-toggle="dropdown">@item.Name</a>
                <ul class="dropdown-menu">
                @foreach (var subItem in subItems)
                {
                    <li><a href="@subItem.Url">@subItem.Name</a></li>
                }
                </ul>
                </li>
            }
            else
            {
                <li @Html.Raw(selected)><a href="@item.Url">@item.Name</a></li>
            }
        }
        </ul>
    
    
    
  • Drew Garratt 44 posts 192 karma points
    Feb 22, 2013 @ 14:23
    Drew Garratt
    0

    Hi Greg,

    I also came across an error that had me head scratching for a bit in PageTitle.cshtml . In the end I avoided the .pluck method and opted to replaces with the slightly longer foreach to get things running.

     

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @{
        @Model.AncestorsOrSelf().First().SiteName
        if (@Model.Level > 1)
        {
            foreach (var name in Model.AncestorsOrSelf().Where("Visible").Where("Level > 1").Pluck("Name"))
            {
                @Html.Raw(" - ");
                @name ;
            }
        }
    }
    
  • Greg 6 posts 27 karma points
    Feb 24, 2013 @ 19:08
    Greg
    0

    Thanks Drew, that is helpful!

  • Steve Brown 125 posts 290 karma points
    Mar 07, 2013 @ 22:06
    Steve Brown
    0

    Other than these initial hiccups with razor, has anyone had success using this starter kit with umbraco 6? I'm new to umbraco and like the idea of this starter kit very much since it uses the bootstrap framework. I've worked through the initial razor syntax fixes and have a basic site running, but are you guys encountering any further issues farther into development?

  • Drew Garratt 44 posts 192 karma points
    Mar 10, 2013 @ 09:53
    Drew Garratt
    0

    Hi Steve,

    Since I prepared a v6 version of the package (I updated the razor scripts and all the dependencies to the latest version) I've not seen any problems further down the road. I've also couple this package with a bunch of others including of course uComponents and a custom extension I've written.

  • Steve Brown 125 posts 290 karma points
    Mar 11, 2013 @ 14:08
    Steve Brown
    0

    Thanks Drew

  • Andrew Parker 23 posts 88 karma points
    Mar 18, 2013 @ 16:45
    Andrew Parker
    0

    Has anyone had similar problems with the ResizeImage script?

    I've got uBootstrap installed on Umbraco 6 - and made the changes to the navigation.cshtml and pagetitle.cshtml - everything seems to be working except I'm not getting any images. The output from ResizeImage.cshtml seems to be completely empty in the page source - any ideas?

    Andrew

  • Drew Garratt 44 posts 192 karma points
    Mar 18, 2013 @ 22:03
    Drew Garratt
    0

    Hi Andrew,

    There seems to be a bit of a issue with creating the content nodes in the package on v6 that means that the gallery nodes don't actually have any images picked. So the reason the gallery appears blank is that there are actually any images set. Check the image pickers on those content nodes are set and give it a wirl =)

  • Andrew Parker 23 posts 88 karma points
    Mar 19, 2013 @ 10:24
    Andrew Parker
    0

    Ha - thanks Drew - works perfectly :-)

  • Larsi 2 posts 22 karma points
    Mar 21, 2013 @ 23:07
    Larsi
    0

    Hi!

    Are the fixes above included in the latest version? I tried the one 1.1.0 from http://our.umbraco.org/projects/starter-kits/ubootstrap and it  does'nt seem to have the fixes included. Also tried github, but did'nt find source there.

    Update: Sorry, I did not look in the correct branch. Found package 1.1.1 in the umbraco branch, works like a charm. Thanks :-)

    Larsi

     

  • Mike 21 posts 42 karma points
    May 12, 2013 @ 10:41
    Mike
    0

    "Found package 1.1.1 in the umbraco branch, works like a charm. Thanks :-)"

    @Larsi
    To make this forum a little bit better it would be great if you could add a link to the solution or a discription how to find it. Beacuse not all people can find the way from the information within your update

  • Jytte Madsen 11 posts 31 karma points
    May 23, 2013 @ 19:19
    Jytte Madsen
    0

    I´m new in this forum.

    Can anyone tell me what an umbraco branch is and where to find it?

  • ... 20 posts 41 karma points
    Jun 12, 2013 @ 14:50
    ...
    0

    Hi there @Larsi

    Will you be linking to the package you found? I think a few of us would really appreciate this.

  • Demóstenes Muniz Brito 1 post 21 karma points
    Jun 13, 2013 @ 03:32
    Demóstenes Muniz Brito
    0

    Hi all!

    Same problem with file RelatedLinks.cshtml with Umbraco 6.0:
    Error loading MacroEngine script (file: RelatedLinks.cshtml) 

    Code:

    @using umbraco.MacroEngines
    @inherits DynamicNodeContext
    @{
    var links = @Model.AncestorsOrSelf().First().FooterLinks.link;
    <ul class="nav nav-pills">
    <li><span>@Dictionary.RelatedLinks</span></li>
       @foreach (var item in links)
       {  var url = item.type == "internal" ? Library.NodeById(item.link).Url : item.link;
          var rel = item.type == "external" ? " rel=\"external\"" : string.Empty;
         var title = item.title;
        <li><a href="@url"@Html.Raw(rel)>@title</a></li>
    }
    </ul>
    }

     

     

  • Djan Blom 99 posts 161 karma points
    Jun 18, 2013 @ 01:48
    Djan Blom
    0

    Hi, 

    I'd like to know if someone has an idea about how to make the umbNaviHide work with the Navigation.cshtml? doesnt seem to be working for me. 

     Also, id like to move the root 'a level down', can anyone explain where to do so? 

    Kind Regards, 
    Djan 

  • rich hamilton 117 posts 136 karma points
    Jun 27, 2013 @ 12:09
    rich hamilton
    0

    Demóstenes,

    I am also having the same problem with file RelatedLinks.cshtml with Umbraco 6.0:

    have you fixed this yet?

  • Pagggy 28 posts 71 karma points
    Jul 27, 2013 @ 22:37
    Pagggy
    0

    has anyone fixed issue with RelatedLinks.cshtml ?

  • Connie DeCinko 931 posts 1160 karma points
    Sep 20, 2013 @ 19:35
    Connie DeCinko
    0

    NewsList.cshtml also refuses to work, cannot even save it as is in the editor. Keeps barking at me about a missing curly brace } even though all that should be are there.

    @using umbraco.MacroEngines
    @inherits DynamicNodeContext
    @{
        const int maxNoChars = 100;
        var events = @Model.Children.OrderBy("NewsDate desc");
        foreach (var item in events)
        {
            <div class="well">
                <h4><a href="@item.Url">@item.Name</a></h4>
                <p><span class="label">@item.NewsDate.ToString(@Dictionary.TimeFormat)</span> @Library.Truncate(Library.StripHtml(item.BodyText.ToString()), maxNoChars, true)</p>
            </div>
        }
    }
    
  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Sep 21, 2013 @ 21:41
    Jeroen Breuer
    0

    Umbraco v6 uses MVC 4 with Razor 2.0 and that has some changes: http://issues.umbraco.org/issue/U4-1143#comment=67-4333

    "using @ in a codeblock will now break the rest of the razor script."

    So you need to remove the following @ characters

    @Model.Children.OrderBy("NewsDate desc");

    @Dictionary.TimeFormat

    Jeroen

  • Adam Nilsson 27 posts 117 karma points
    Oct 09, 2013 @ 08:13
    Adam Nilsson
    0

    Hi!

    I am running Uboostrap 1.1.1 on Umbraco 6.1.1 but there is private memory leak on server 1GB on one page and 590MB on the 2th page is that normal?

     

    Regards Adam

  • Nigel 29 posts 52 karma points
    Nov 04, 2013 @ 15:42
    Nigel
    0

    // Sight change to the RelatedLinks.cshtml file so that there is no error when no links are added

    @using umbraco.MacroEngines
    @inherits DynamicNodeContext
    @{
    
        var links = @Model.AncestorsOrSelf().First();
    
        <ul class="nav nav-pills">
        <li><span>@Dictionary.RelatedLinks</span></li>
    
           @foreach (var item in links.FooterLinks)
            {
                var url = item.type == "internal" ? Library.NodeById(item.link).Url : item.link;
                var rel = item.type == "external" ? " rel=\"external\"" : string.Empty;
                var title = item.title;
                <li><a href="@url"@Html.Raw(rel)>@title</a></li>
            }
        </ul>
    }
  • Graeme W 113 posts 289 karma points
    Dec 20, 2013 @ 13:35
    Graeme W
    0

    I've got this up and running on v6 - thanks to everyone who posted the code fixes above.

    One thing I can't work out - all the pages - even ones I add - have "http://en.umbraco.local/" at the start of the url after being published and I can't for the life of me work out why!

    *** Update to answer my own question: the domain setting can be found by right-clicking on the home node, then selecting "culture and hostnames".  ***

     

     

Please Sign in or register to post replies

Write your reply to:

Draft