I was looking for a true false with a default value and i found out that togglebox was just what i need. I can access the value through umbraco:item inside template without anyproblem, but for some reason inside xslt the value wont return. I use this code:
Maybe the value is null and therefore will never return a value. What I mean by that is: have you ticked the tick box and then check to see if a value is output. And then untick it, republish and again check if a value is output. In this case it might be "0" due to the changes made. But it you have never changed the value since creating the node it mgiht be null.
So maybe in your xslt you could try this (not sure this is the most efficient but it may solve the problem):
Nigel is right, the togglebox property doesn't contain/output a value in the XML until it has been set. This is different than the checkbox property, which is often used for umbracoNaviHide, which outputs "0" by default, and "1" when checked.
So when you use the value in a predicate to only output non-hidden pages, simply do it like this:
...which will work regardless of whether the value is "0" or not set at all.
I don't know if you've tried it, but Chriztian's XMLDump package is great for debugging this kind of thing, when you need to see the XML that you are working with.
I found out that it was like everything else in umbraco, that already existing documents or nodes in the content tree will stay null and not 1. New documents will have a default value of 0.
ToggleBox
Hello everybody.
I was looking for a true false with a default value and i found out that togglebox was just what i need. I can access the value through umbraco:item inside template without anyproblem, but for some reason inside xslt the value wont return.
I use this code:
<xsl:value-of select="$currentPage/umbracoNaviHide"/>
If i use this command for getting the @nodeName i get it without the problem så the param $currentPage is not the problem.
<xsl:value-of select="$currentPage/@nodeName"/>
I have double checked the name and it is correct.
I realy cant find a solid reason for why i cant get the value.
Hi Matias
Just a guess...
Maybe the value is null and therefore will never return a value. What I mean by that is: have you ticked the tick box and then check to see if a value is output. And then untick it, republish and again check if a value is output. In this case it might be "0" due to the changes made. But it you have never changed the value since creating the node it mgiht be null.
So maybe in your xslt you could try this (not sure this is the most efficient but it may solve the problem):
Good luck.
Cheers
Nigel
Nigel is right, the togglebox property doesn't contain/output a value in the XML until it has been set. This is different than the checkbox property, which is often used for umbracoNaviHide, which outputs "0" by default, and "1" when checked.
So when you use the value in a predicate to only output non-hidden pages, simply do it like this:
...which will work regardless of whether the value is "0" or not set at all.
I don't know if you've tried it, but Chriztian's XMLDump package is great for debugging this kind of thing, when you need to see the XML that you are working with.
I found out that it was like everything else in umbraco, that already existing documents or nodes in the content tree will stay null and not 1. New documents will have a default value of 0.
Right — and if you right-click the Content node and select "Republish entire site", they should all get a value.
But in any event, the above mentioned method of handling umbracoNaviHide works for both non-existing values and any value other than "1".
is working on a reply...