Select nodeTypeAlias and check to see if property equals true
I have been trying to figure out how to display a Events list only if a property equals true. What i have is an Events list with a property of sports. I am trying to display the events if the nodeTypeAlias and the sports property is checked true. Any thought
Thanks for the responce Matt. Here is what i have currently with you addition. It seems to not display anything. I checked and i do have some event with the sports checked. Any other thoughts?
I checked them and they they are correct. Im not sure if this is the problem or not. I have a document type set up for
Events list ('CWS_EventsList) and Event Items (CWS_EventItem). The event item has the propertyAlias of (ListSportsEvent). I think they way i have it is checking the Events list for the propertyAlias. Do i need to reference the Eventitem the check for the propertyAlias? If so how
Select nodeTypeAlias and check to see if property equals true
I have been trying to figure out how to display a Events list only if a property equals true. What i have is an Events list with a property of sports. I am trying to display the events if the nodeTypeAlias and the sports property is checked true. Any thought
Here is the code that i have currently
<
xsl:for-each select="$currentPage/ancestor-or-self::node//node [@nodeTypeAlias ='CWS_EventsList']/node">
This should do the job
Matt
Thanks for the responce Matt. Here is what i have currently with you addition. It seems to not display anything. I checked and i do have some event with the sports checked. Any other thoughts?
<ul class="events">
<xsl:for-each select="$currentPage/ancestor-or-self::node//node [@nodeTypeAlias ='CWS_EventsList' and string(data[@alias='ListSportsEvent']) = '1']/node">
<xsl:sort select="data [@alias = 'eventDate']" order="ascending"/>
<!-- Position() <= $noOfItems -->
<xsl:if test="position()<= $noOfItems">
<li>
<span class="footerboxevents">
<em>
<!-- Date Format: 15.12.08 -->
<xsl:choose>
<xsl:when test="@nodeTypeAlias = 'CWS_EventItem'">
<xsl:value-of select="umbraco.library:FormatDateTime(data [@alias='eventDate'], 'dd.MM.yy')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="umbraco.library:FormatDateTime(@createDate, 'dd.MM.yy')"/>
</xsl:otherwise>
</xsl:choose>
</em>
<a href="{umbraco.library:NiceUrl(@id)}">
<br/>
<span style="font-size:14px;" class="footerboxevents">
<xsl:value-of select="@nodeName"/>
</span></a>
</span>
<hr/>
</li>
</xsl:if>
</xsl:for-each>
</ul>
Hey Eric,
I'd double check the docTypeAlias and propertyAlias names, as XSLT is case sensitive.
Matt
I checked them and they they are correct. Im not sure if this is the problem or not. I have a document type set up for
Events list ('CWS_EventsList) and Event Items (CWS_EventItem). The event item has the propertyAlias of (ListSportsEvent). I think they way i have it is checking the Events list for the propertyAlias. Do i need to reference the Eventitem the check for the propertyAlias? If so how
Ahhh, ok, I think I missunderstood you question, give this a go:
Matt
Thanks a ton. That did the trick. I new at Umbraco and XSLT. So its going to take some time to learn all the stuff. Thanks agian for all you help.
Thanks a ton. That did the trick. I new at Umbraco and XSLT. So its going to take some time to learn all the stuff. Thanks agian for all you help.
No problem, glad you got it working.
Matt
is working on a reply...