I have a checkboxlist custom datatype. The checkboxlist values are set in the content. I'm trying to iterate over the values in the datatype and pull back all nodes tagged with the selected properties. I can't seem to pull back just the selected nodes, without pulling back everything.
Datatype Options:
Current Output (notice the same article being brought back under each Type):
Thanks for the help on this one, Dennis. Unfortunately, I can't switch the datatype to an ultimate picker as I have content already in the for the datatype which would be lost. I've used them in the past and have been able to parse a list like this in the past using that approach. But for this one, I'm trying to avoid having the SubFolder with different types. That was my reasoning for using a generic checkbox list.
Still, I'd think there has to be a way to accomplish this.
Can we add new property in Ultimate picker to show GradChild ID..??
Suppose I have 5 child page.. If i want to show Id at shown in second figure text box of that grandchild pages with checkbox list in content then what to do??
I anyone have idea about that than please tel me..
This examplepicturewilllistallgrandchildrenofnode number1109,butit only shows thegrandchildren of the of documenttypeSubPage.
Then inthefieldyou need to addthedocumenttype ordocument types,whichmustrepresentthecheckboxvalues.
I don´t know if it´s posible to add the id of an element.
I hope this make sense, and it will help you further. If not feel free to ask again. I´am sure that other members on this forum also will try to help you.
Retrieve Items by Datatype Values
I have a checkboxlist custom datatype. The checkboxlist values are set in the content. I'm trying to iterate over the values in the datatype and pull back all nodes tagged with the selected properties. I can't seem to pull back just the selected nodes, without pulling back everything.
Datatype Options:
Current Output (notice the same article being brought back under each Type):
Hi Justin,
I will try to help you as much as I can.
First, I created a property in my document type named checkbox.
The data type I use is the ultimate picker.
On the ultimate picker datatype I set type to checkbox list, as shown below in the picture.
Here I choose also the parent node to a pull from, and what documtype individual choice options should have, and whether to take grandchildren.
My XSLT to this, look likes this, perhaps this can be written in more appropriate way.
<xsl:template match="/">
<xsl:variable name="relItems" select="$currentPage/checkBox" />
<xsl:variable name="nodeIds" select="umbraco.library:Split($relItems, ',')" />
<xsl:for-each select="$nodeIds/value">
<xsl:call-template name="select_products">
<xsl:with-param name="product_Id" select="."/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<xsl:template name="select_products">
<xsl:param name="product_Id"/>
<xsl:variable name="productNode" select="umbraco.library:GetXmlNodeById($product_Id)"/>
<xsl:for-each select="$productNode">
ID: <xsl:value-of select="$productNode/@id"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
But I hope this small example can help you to solve your question.
/Dennis
Thanks for the help on this one, Dennis. Unfortunately, I can't switch the datatype to an ultimate picker as I have content already in the for the datatype which would be lost. I've used them in the past and have been able to parse a list like this in the past using that approach. But for this one, I'm trying to avoid having the SubFolder with different types. That was my reasoning for using a generic checkbox list.
Still, I'd think there has to be a way to accomplish this.
Hi Justin,
The way I've worked with my solution is to create new data types, which just has the same setup as the ultimate picker. As you mention in your post.
So I hope you can use my suggestion for your solution. If you create a new data type, which is a copy of the ultimate picker.
Since it is not possible to copy data types, you have to check the ultimate pickers settings and make the same on your new data types.
Hope this can help you further.
/Dennis
Figured this one out. I was pretty close originally.
Updated Code to:
<xsl:template name="entriesByType"> <xsl:param name="type" /> <xsl:for-each select="$povTopNode/self::*[@isDoc][contains(povType, $type)]"> <a href="{umbraco.library:NiceUrl(./@id)}"><xsl:value-of select="@nodeName" /></a><br /> </xsl:for-each> </xsl:template>
Can we add new property in Ultimate picker to show GradChild ID..??
Suppose I have 5 child page.. If i want to show Id at shown in second figure text box of that grandchild pages with checkbox list in content then what to do??
I anyone have idea about that than please tel me..
Thanks in advance...
Hi urvish,
This example picture will list all grandchildren of node number 1109, but it only shows the grandchildren of the of documenttype SubPage.
Then in the field you need to add the document type or document types, which must represent the checkbox values.
I don´t know if it´s posible to add the id of an element.
I hope this make sense, and it will help you further. If not feel free to ask again. I´am sure that other members on this forum also will try to help you.
/Dennis
is working on a reply...