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
Currently my code is as follows
var recipeTypes = umbraco.library.GetPreValues(1174);<p>@recipeTypes</p><ul> @foreach(var item in recipeTypes) { <li>@item</li> }</ul>
This returns the following
MS.Internal.Xml.XPath.XPathSelectionIterator
I have used the snippet below to achieve what I was looking for
@{
XPathNodeIterator recipeTypes = umbraco.library.GetPreValues(1174);
recipeTypes.MoveNext();
XPathNodeIterator preValueIterator = recipeTypes.Current.SelectChildren("preValue","");
<li class="heading">Ingredient</li>
<ul>
@while(preValueIterator.MoveNext()) {
searchUrl = String.Format("{0}&mainIngredient={1}", @templateUrl, @preValueIterator.Current.GetAttribute("id",""));
<li>
<a href="@searchUrl">
@preValueIterator.Current.Value
</a>
</li>
}
</ul>
Apologies for the code formatting, the creating a post allowed me to set styling to 'Code' but in a reply it has changed to 'Preformatted'... which doesn't work anywhere near as good?!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Iterator GetPreValues
Currently my code is as follows
This returns the following
MS.Internal.Xml.XPath.XPathSelectionIterator
I have used the snippet below to achieve what I was looking for
@{
XPathNodeIterator recipeTypes = umbraco.library.GetPreValues(1174);
recipeTypes.MoveNext();
XPathNodeIterator preValueIterator = recipeTypes.Current.SelectChildren("preValue","");
<li class="heading">Ingredient</li>
<ul>
@while(preValueIterator.MoveNext()) {
searchUrl = String.Format("{0}&mainIngredient={1}", @templateUrl, @preValueIterator.Current.GetAttribute("id",""));
<li>
<a href="@searchUrl">
@preValueIterator.Current.Value
</a>
</li>
}
</ul>
}
Apologies for the code formatting, the creating a post allowed me to set styling to 'Code' but in a reply it has changed to 'Preformatted'... which doesn't work anywhere near as good?!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.