I have a True/False datatype called 'onoff' and was hoping I could use it to turn items on of off on a page... but I am getting something wrong - This is my code:
Hey Chriztian - I found this in the dump when it was checked
<data alias="onoff">1</data>
And this when it was unchecked
<data alias="onoff">0</data>
Ah - sorry - I have figured it out - it is an older install of umbraco which is using legacy code - this i what I needed to use... the new code looks much easier though :)
xslt DataTyle True/False
Warning - xslt dummy here :)
I have a True/False datatype called 'onoff' and was hoping I could use it to turn items on of off on a page... but I am getting something wrong - This is my code:
But what I am getting is always the Empty comment.... the DataType is a checkbox which you tick or untick...
Any ideas where I'm going wrong? Or any more efficient methods of acheiving the same thing - I'm always willing to learn.
Hi Tizer,
That *should* work, so I'm guessing the alias is actually "onOff" ?
(E.g., if you Labeled it "On/Off" on the property, the allias would be transmogrified into "onOff")
To be sure, you can dump the entire currentPage XML to a textarea and examine it:
/Chriztian
Hey Chriztian - I found this in the dump when it was checked
And this when it was unchecked
Ah - sorry - I have figured it out - it is an older install of umbraco which is using legacy code - this i what I needed to use... the new code looks much easier though :)
That is a great tip regarding dumping the currentPage XML though - I think I might be using that lots - thanks
Hi Tizer,
That explains it :-)
PS: Have a look at the XMLDump package for a steroids-powered view of the XML :-)
/Chriztian
PPS: You can strip the self::node part from that XPath:
/Chriztian
is working on a reply...