Letterlist A-Z (tt_address mit last_name)

constants.txt

lib {
	tt_address {
		list {
			# ID von der Gruppe angeben
			selectAddressGroup = X?
			# ID vom SysOrdner angeben
			pidList = Y?
		}
	}
}
setup.txt

10 = COA
10 {

	1 = LOAD_REGISTER
	1 {
		firstLetter.value =
	}

	10 = CONTENT
	10 {
		# Tabellenname
		table = tt_address
		select{
			# PID welche bei tt_address drin steht
			pidInList= {$lib.tt_address.list.pidList}
			# Sortierung
			orderBy = last_name
			# Feld einschräkung
			selectFields = last_name
			# Maximale Anzahl
			#max = 10
			# verbindung zu mm (Kategorie)
			leftjoin = tt_address_group_mm ON (tt_address.uid = tt_address_group_mm.uid_local)
			# einschräkung auf eine Kategorie
			where = tt_address_group_mm.uid_foreign = {$lib.tt_address.list.selectAddressGroup}
		}

		renderObj = COA
		renderObj {
			5 = LOAD_REGISTER
			5 {
				fLetter = TEXT
				fLetter {
					field = last_name
					crop = 1|
				}
			}

			10 = TEXT
			10 {
				data = field:last_name
				innerWrap = |
				crop = 1|
				typolink {
					# PID der Ziel Seite
					parameter.data = TSFE:id
					useCacheHash = 1
					additionalParams = &tx_ttaddress_pi1[last_name]={register:fLetter}
					additionalParams.insertData = 1

					ATagParams = class="cur"
					ATagParams {
						if {
							value.data = GP:tx_ttaddress_pi1|last_name
							value {
								# Default Wert, wenn kein Param
								override = A
								override {
									if.isFalse.data = GP:tx_ttaddress_pi1|all // GP:tx_ttaddress_pi1|last_name
								}
							}
							equals.field = last_name
							equals.crop = 1|
						}
					}
				}
				# nur wenn nicht bereits vorhanden
				if {
					value.data = register:firstLetter
					equals.field = last_name
					equals.crop = 1|
					negate = 1
				}
				wrap = <li>|</li>
			}

			15 = LOAD_REGISTER
			15 {
				firstLetter.field = last_name
				firstLetter.crop = 1|
			}

		}
		wrap = <ul class="ttaddressLetterList">|</ul>
	}
}