I'am making a page with filtering of cases using the jQuery plugin Quicksand.
I need to output a list of tags based on all the nodes with isACase == true. (First part of code)
Futhermore the tags (datatype is a checkbox list because the tags is defined), but some are with spaces ... how can I remove the whitespace in 'This Is A Tag' so it becomes 'ThisIsATag'?
My code:
@{ var root = Model.AncestorOrSelf(); var nodes = root.Descendants().Where("NodeTypeAlias == @0 and Visible", "Timestamp"); } <div class="twelve columns noPadding"> <ul class="filter_list"> <li class="current"><a href="javascript:;" class="all-items">All</a></li> LIST ALL TAGS HERE </ul> </div>
Can you also help me with my other question? My problem is, that I get dublicated tags - the code runs through each node that has the 'isACase == true' and list the tags ...
From the top of my head there may be 2 ways of doing this:
You can create a second array to hold the list you actually want to show on the page. Compare each tag to the new array, with a flag when a match is found. If there isn't a match (e.g. the flag isn't raised for a match), add the tag to the new array.
Tags, whitespace and filtering
Hi all fine folks!
I'am making a page with filtering of cases using the jQuery plugin Quicksand.
I need to output a list of tags based on all the nodes with isACase == true. (First part of code)
Futhermore the tags (datatype is a checkbox list because the tags is defined), but some are with spaces ... how can I remove the whitespace in 'This Is A Tag' so it becomes 'ThisIsATag'?
My code:
@{
var root = Model.AncestorOrSelf();
var nodes = root.Descendants().Where("NodeTypeAlias == @0 and Visible", "Timestamp");
}
<div class="twelve columns noPadding">
<ul class="filter_list">
<li class="current"><a href="javascript:;" class="all-items">All</a></li>
LIST ALL TAGS HERE
</ul>
</div>
<div class="twelve columns noPadding filter_items">
@foreach (var node in nodes.Where("isACase == true").OrderBy("timelineDate desc")) {
if (@node.HasValue("casePhoto")) {
dynamic mediaItems = @node.casePhoto.mediaItem;
<div class="three columns case"
@if (node.HasProperty("timelineTags")) {
string[] tagsList = node.timelineTags.ToString().Split(',');
if (tagsList.Count() > 0) {
<text>data-type="</text>
foreach (var tag in tagsList) {
@tag<text> </text>
}<text>"</text>
}
}
>
<div class="thumb">
<a href="@node.Url" title="@node.Name">
@if (mediaItems.Count() != 0) {
foreach (var item in mediaItems) {
var image = item.Image;
<img data-original="@image.umbracoFile" src="/css/images/lazy.gif" class="lazy" alt="@image.nodeName" />
<noscript><img src="@image.umbracoFile" /></noscript>
}
}
<div><span>@node.Name</span></div>
</a>
</div>
</div>
}
}
</div>
d
Hi,
You should be able to format your tags like so:
Thanks SC Web Team - That worked!
Can you also help me with my other question? My problem is, that I get dublicated tags - the code runs through each node that has the 'isACase == true' and list the tags ...
Best regards
Kim
From the top of my head there may be 2 ways of doing this:
is working on a reply...