Thanks for correcting the syntax of that line of code. I wouldn’t have known about it! That seems to work well now.
I’m getting a problem elsewhere now, however. As per the suggestion above, I’ve added an RTE and a checkbox TV. The RTE works fine, but the checkbox doesn’t preserve its state. When I check the box and save (this happens whether there is content in the RTE TV or not), upon reloading the document to edit, the box is unchecked, and the new "draft" content in the RTE TV does not get displayed on the site, only the correct "live" content is shown.
Why wouldn’t the state of the checkbox be saved along with the rest of the document’s changes?
Are you using Safari on a Mac and Tiny MCE 2.1.2 as the RTE?
I’ve heard of some issues with RTE TV’s not saving correctly with the above combination.
I’m using Firefox 3.0 RC2 on Win XP, and using Tiny MCE 2.1.1.1 on ModX 0.9.6.
There were some reports of issues with FF3 and Javascripts, have you tried with another browser?
I just tested it with MSIE 7 & 6, and the same problem occirred on both browsers.
Do you have a Default Value? If it is set to inherit that might be it.
Thanks for the suggestion, I looked into it, and did some more testing, and that definately seems related.
For the checkbox TV, when I leave the "Default Value" field empty, the box is checked by default, and when the document is saved it stays checked EVEN IF I unchecked it then saved. Also, the content in the "draft content" TV is NOT displayed to a logged-in admin when the check box is checked.
When I put "0" in the Default Value of the checkbox TV, the checkbox is unchecked by default, and stays as such after saving, EVEN IF I check it and save.
It seems that both TVs are being completely ignored by ModX.
Just for confirmation, this is the code I’m using in the template in place of [*content*]:
[+phx:if=`[*show_draft*]`:is=`1`:and:mo=`Admins`:then=`[*test_draft*]`:else=`[*content*]`+]