I have a TV assigned to a template:
input type: date, display type: unixtime
input option and default the same @eval:
@EVAL return $modx->runSnippet('firstDate');
The snippet returns a date collected from another document’s date TV. I tried some formatting for the output
- as unix timestamp: 1217102289
- formatted via strftime("%d-%m-%Y %H:%M:%S", $datevar): 26-07-2008 21:58:09
The result in edit mode of a document using the template with assigned TV is: "(not set)"
Using 0.9.6.1p2 on
PHP Version 5.2.6, Linux, Apache/2.2, MySQL 5.0.32, UTF-8
PHx, ManagerManager (disabled or not: same result)
Why the TV is unset?
Putting [*dateTvName*] anywhere in the template source code for a visual output at rendered page give back the result of the snippet. (Gives only back an output if the TV IS NOT display type unixtime).
But using the TV in snippets like Ditto (as sortBy parameter) for other pages failes. And this is my problem: I need this value for sorting Ditto output at start page.
Is the error in the TV, in MODx or in front of the monitor
ADDITIONAL: debug mode at start page says that the TV is "0". All other output seen in debug is ok.
Tried other versions of @eval any (other) snippet outputs as various input types. The result is always the @eval code as text and NEVER the snippet’s return value.
Seems that the TV never gets the snippet’s output. What’s wrong? Need help please.