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
Hey there...I have created a checkbox list datatype, which list all the rooms in a building.
I then have a serviceItem doc type which uses the above datatype. When the CMS user adds a new service item like "Flat screen TV" they can then check which room has this service.
So far so good i think!?
I now want to pull out using XSLT the list of services for each room, so my question is how do i check that a checkbox is checked?
I would have a look at your App_Data/Umbraco.config file and see who the data is held, if I remember rightly it's CSV.
So you can use a 'contains' in XSLT, remember to add a preceeding and trailing comma, so you get an exact match.
Hope this helps
Hey Rich thanks for the heads up on that worked a treat...I'm now thinking i want to extend this further... :-)
I've made my working XSLT a macro and allowed the user to insert via editor...can i use the datatype checkbox list that i created to enter the macro parameters?
I dont see the option in the parameter type dropdown...
Glad you got that one bit worked out.
Not sure I understand your other question?
often the case!
Ok i have my XSLT that lists services by room like so...
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " ">]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" exclude-result-prefixes="msxml umbraco.library"> <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:param name="currentPage"/> <xsl:template match="/"> <h3><xsl:value-of select="$currentPage/@nodeName" /> Services</h3> <xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc]/ServiceHome/* [@isDoc]"> <xsl:sort select="@createDate" order="ascending"/> <!-- Position() <= $noOfItems --> <xsl:if test="contains(rooms, 'The London Room')"> <h4><xsl:value-of select="@nodeName" /></h4> <p><xsl:value-of select="umbraco.library:StripHtml(serviceDescription)"/></p> </xsl:if> </xsl:for-each> </xsl:template></xsl:stylesheet>
So i've made this a macro so that the user can insert the code above into a text editor. However the above code use the hardcoded "The London Room" where as i would like to let the user select which room they want when inserting the macro.
It would seem the best way would be to re-use the datatype checkbox list of the rooms but can i do this for the parameters?
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted