Im trying to make a list of products, and for each fourth product I want a <div class="row">
However, it's not working, when im saving the razor file, I dont get any errors, but when watching the page, i get an error messag: Error loading MacroEngine script (file: FitnessListShopItems.cshtml)
Have you checked it the parameter is passing through correctly? So what does it display if you add <span>@param</span> under @{var param = @Parameter.FolderID;} ?
Also, add ?umbDebugShowTrace=true to the querystring to see if there's any errors (you have to have umbracoDebugMode set to true in the web.config for this to work).
for() problem maybe?
Hey guys...
Im trying to make a list of products, and for each fourth product I want a <div class="row">
However, it's not working, when im saving the razor file, I dont get any errors, but when watching the page, i get an error messag: Error loading MacroEngine script (file: FitnessListShopItems.cshtml)
Any ideas to whats wrong?
This is the code:
EDIT:
I've tried changing it into this, but it's like its not even getting into the first foreach loop, as it not outputting the <div class="row">
@inherits umbraco.MacroEngines.DynamicNodeContext
@using umbraco.MacroEngines;
@{var param = @Parameter.FolderID;}
@foreach (var group in Model.NodyById(param).Children.InGroupsOf(4))
{
<div class="row">
@foreach (var item in group)
{
<div class="col">
<div class="wrap-col">
<div class="shop-image">
<img alt="@item.Name" title="@item.Name" src='@item.Media("fitnessShopImage", "umbracoFile")' />
</div>
<umbraco:Macro Alias="FitnessImage" runat="server"></umbraco:Macro>
<div class="shoptext">
@item.shopContent
</div>
<div class="price">
@item.price
</div>
<a href="@item.shopLink">Køb nu</a>
</div>
</div>
}
</div>
}
Have you checked it the parameter is passing through correctly? So what does it display if you add <span>@param</span> under @{var param = @Parameter.FolderID;} ?
Also, add ?umbDebugShowTrace=true to the querystring to see if there's any errors (you have to have umbracoDebugMode set to true in the web.config for this to work).
Ahhhh, my bad...
Somehow all the items in the folder was unpublished, then of course it couldnt output any items... Doh! :)
No problem, at least you got to learn about InGroupsOf and simplify your code! :-)
is working on a reply...