Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi, in the macro for a gallery (below), I have a line:
figClass = " class=/"fourthFigure/"";
which outputs as <figure class="fourthFigure">
How do I get it to output as <figure class="fourthFigure">
Can't work out how.
Any advice appreciated.
Craig
@{ //Check the currentpage has a value in the property 'MediaFolder' if (Model.HasValue("mediaFolder")) { var MediaFolder = Library.MediaById(Model.mediaFolder); var width = Parameter.w; var height = Parameter.h; var count = 1; var figClass = ""; <div class="galleryContainerDiv"> @foreach (var picture in MediaFolder.Children) { if(count == 4){ figClass = " class=/"fourthFigure/""; count = 0; } <figure@figClass> <img src="/[email protected]&AltImage=noimage-newslist.gif&width=@width&height=@height" width="@width" height="@height" alt="@picture.Name"> <figcaption>@picture.Name</figcaption> </figure> figClass = ""; count++; } </div> } }
change
<figure@figClass>
into
<figure @Html.Raw(figClass)>
Thanks for that Bert! I'd tried a few things including Html.Raw but around the line setting the figClass value but nothing seemed to work.
Thanks again,
*delete this post*
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Razor text encoding problem
Hi, in the macro for a gallery (below), I have a line:
which outputs as <figure class="fourthFigure">
How do I get it to output as <figure class="fourthFigure">
Can't work out how.
Any advice appreciated.
Craig
change
into
Thanks for that Bert! I'd tried a few things including Html.Raw but around the line setting the figClass value but nothing seemed to work.
Thanks again,
Craig
*delete this post*
is working on a reply...