[TYPO3-ttnews] Alternating background colors with tt_news

Alexandre Bourget alexandre.bourget at savoirfairelinux.com
Fri Oct 19 15:36:54 CEST 2007


Hello,

I'm new to all those Typo3 extensions, but I've patched tt_news to allow
for background toggling very easily:

Here it is attached.

Feedbacks are welcome. Maybe you can point me to some best-practice
where I've failed.

-- 
Alexandre Bourget
Consultant en Logiciel Libre
Savoir-faire Linux Inc.
alexandre.bourget at savoirfairelinux.com
514-276-5468 poste 124
-------------- next part --------------
Author: Alexandre Bourget <alexandre.bourget at savoirfairelinux.com>
Date:   Thu Oct 18 16:50:22 2007 -0400

Add alternate display (class toggle for example) to tt_news.

diff --git a/typo3conf/ext/tt_news/pi/class.tx_ttnews.php b/typo3conf/ext/tt_news/pi/class.tx_ttnews.php
index e51d79c..1451815 100644
--- a/typo3conf/ext/tt_news/pi/class.tx_ttnews.php
+++ b/typo3conf/ext/tt_news/pi/class.tx_ttnews.php
@@ -970,6 +970,10 @@ class tx_ttnews extends tslib_pibase {
 			}
 			$markerArray = $this->getItemMarkerArray($row, $prefix_display);
 
+			// Add a toggle to the markers (toggle between 0 and 1)
+			// for alternate news displays.
+			$markerArray['###NEWS_TOGGLE_DISPLAY###'] = ($cc % 2);
+
 			// XML
 			if ($this->theCode == 'XML') {
 				if ($row['type'] == 1 || $row['type'] == 2) {


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