I have an event implementation that I've written, everything is smashing except when I'm outputing individual events onto a template. I have an eventDate and eventEndDate, obviously end date should only show if it exists, otherwise the event is only one day long. Here's the issue:
Here's the issues, eventEndDate by default returns the current date if the eventEndDate doesn't exist. I dont want it to return anything. It makes no sense that having formatAsDate turned on would make it spit out the current date when the field is empty. All other umbraco:item behavior doesn't do this and will just not show if the field it is targeting is empty, unless an alternate field has been speicifed. Why is this instance different, and how can I fix it?
Yeah, I've been able to do this with a Macro. Thanks. I was really more curious why in the world it's set up like this. Having the default functionality of umbraco:item's not ouput anything if the field is blank EXCEPT for dates is ludicrous.
There's no reason someone would want the current date if the date they were trying to access wasn't available. Really I'm completely confused to why it was done this way.
Don't want current date if blank on umbraco:item
Hi All,
I have an event implementation that I've written, everything is smashing except when I'm outputing individual events onto a template. I have an eventDate and eventEndDate, obviously end date should only show if it exists, otherwise the event is only one day long. Here's the issue:
Here's the issues, eventEndDate by default returns the current date if the eventEndDate doesn't exist. I dont want it to return anything. It makes no sense that having formatAsDate turned on would make it spit out the current date when the field is empty. All other umbraco:item behavior doesn't do this and will just not show if the field it is targeting is empty, unless an alternate field has been speicifed. Why is this instance different, and how can I fix it?
Thanks so much!
-Bruce
Hi Bruce,
You're right, that is odd behaviour.
Looks like you need to create an xslt macro to solve this. The xslt would look something like
Enjoy!
Chris
Yeah, I've been able to do this with a Macro. Thanks. I was really more curious why in the world it's set up like this. Having the default functionality of umbraco:item's not ouput anything if the field is blank EXCEPT for dates is ludicrous.
There's no reason someone would want the current date if the date they were trying to access wasn't available. Really I'm completely confused to why it was done this way.
-Bruce
Not sure why, but it looks like umbraco:Item is specifically hardcoded in to use today's date if empty and format as date is selected.
Just another workaround without using a macro - uncheck format as date and use inline xslt to format it:
Good solution. I've submitted an issue on codeplex for this.
http://umbraco.codeplex.com/workitem/29755
is working on a reply...