[TYPO3-project-seminars] ###FIELD_WRAPPER Generation - where?

Oliver Klee typo3-german-02 at oliverklee.de
Wed Jul 8 13:09:31 CEST 2009


Hi Ben,

Ben Kerner schrieb:
> iŽm thinking about committing my changes to bugtracker for the official 
> version because we use the room and methodology in our project as 
> database-fields, not as strings.

That would be great. :-)

> IŽm wondering where the ###FIELD_WRAPPER - elements and the content-elements 
> in the template-file are get from. Where are they generated? We like to 
> display our new fields in the frontend.

The ###FIELD_WRAPPER subparts are used for hiding the subpart content if
the subpart either is hidden by configuration (e.g. hideFields,
hideColumns) or is empty (e.g. an event has no speakers assigned, so the
"speakers" subpart needs to be hidden in the single view).

Have a look at tx_seminars_pi1::setSpeakersMarker to get the knack:

/**
 * Fills in the matching markers for the speakers or hides the subpart if
 * there are no speakers.
 */
private function setSpeakersMarker() {
	if (!$this->seminar->hasSpeakers()) {
		$this->hideSubparts('speakers', 'field_wrapper');
		return;
	}

	$this->setSpeakersMarkerWithoutCheck('speakers');
}


This function is called from tx_seminars_pi1::createSingleView():

///////////////////////////
// Single view functions.
///////////////////////////

/**
 * Displays detailed data for a seminar.
 * Fields listed in $this->subpartsToHide are hidden (ie. not displayed).
 *
 * @return string HTML for the plugin
 */
private function createSingleView() {
	[snip]
	$this->setGenderSpecificHeading('speakers');
	$this->setSpeakersMarker();
	$this->setGenderSpecificHeading('partners');
	$this->setPartnersMarker();
	$this->setGenderSpecificHeading('tutors');
	$this->setTutorsMarker();
	$this->setGenderSpecificHeading('leaders');
	$this->setLeadersMarker();

Hope this helps,


Oliver


More information about the TYPO3-project-seminars mailing list