[TYPO3-ttnews] multiple date formats (separate Month/Day)

Mario Šargač sargac at gmail.com
Mon Jan 10 15:51:06 CET 2011


Hello,

is it possible to separate a "date" field into a "month" and a "day" 
fields in template, so I would get:

<div class="month">###NEWS_MONTH###</div>
<div class="day">###NEWS_DAY###</div>

----------- Explanation ---------------
I tried 2 things, but couldn't achieve the desired effect. First I tried 
with extension "tt_news_genericmarkers", created 2 new markers similar 
in the example above, and following TS Code:

genericmarkers {
	month = TEXT
	month {
		data = date:M
		wrap = |
	}
	day = TEXT
	day {
		data = date:j
		wrap = |
	}
}

but of course get today's date, instead of a News item's date. If anyone 
knows how to get News item's date, please help.

The other solution #2, I was thinking would be to use existing markers 
from News and customize the format:

displayLatest {
	date_stdWrap.strftime = %b
	time_stdWrap.strftime = %e
}

but unfortunately the "time_stdWrap.strftime" accepts only "time" 
variables, for example %H, and not #e, which I need, 'though both date_ 
and time_ uses strftime formatting.

Best,
Mario









More information about the TYPO3-project-tt-news mailing list