Please note that this documentation is for the most recent version of this extension. It may not be relevant for older versions. Related documentation can be found in the documentation directory of the extension.
Display contact person images
If you would like to display an image of your contact person in the real estate detailed view you can do so by using the assigned email address. We simply get the direkte E-Mailadresse and compare it. If there is a match the image is displayed. In fluid it can look something like this:
<f:switch expression="{oi:getProperty(object: immobilie, index: 'kontaktperson_emailDirekt')}">
<f:case value="ansprechpartner-a(at)typo3-openimmo(dot)de">
--> Bild von Ansprechpartner a anezigen!
</f:case>
<f:case value="ansprechpartner-b(at)typo3-openimmo(dot)de">
--> Bild von Ansprechpartner b anezigen!
</f:case>
<f:case default="1">
Es trifft keine Mailadresse zu - wir zeigen bspw. ein Dummy-Bild.
</f:case>
</f:switch>
Contacts that are updateable by an editor
In the PRO version contacts can be updated by an editor. A Contact Person data record for each contact will need to be created in the OpenImmo data container. You then simply need to add the email address and the image. You can then set the contact person image in fluid as follows:
<oi:variable.set name="email" value="{oi:getProperty(object: immobilie, index: 'kontaktperson_emailDirekt')}" />
<oi:variable.set name="contactPersonImage" value="{oi:contactPerson.image(email: email)}" />
<f:if condition="{contactPersonImage}">
<f:then>
<f:image src="{contactPersonImage.uid}" treatIdAsReference="1" />
</f:then>
<f:else>
Kein Bild gefunden
</f:else>
</f:if>
PDF of contacts that can be updated by an editor
The contacts that can be updated by editors are also available as a PDF file:
<!-- Contact person image -->
<oi:variable.set name="email" value="{oi:getProperty(object: immobilie, index: 'kontaktperson_emailDirekt')}" />
<oi:variable.set name="contactPersonImage" value="{oi:contactPerson.image(email: email)}" />
<f:if condition="{contactPersonImage}">
<f:then>
<fpdf:setFont family="{labelFontName}" style="{labelFontStyle}" size="{labelFontSize}" />
<fpdf:setTextColor hex="{labelColor}" />
<fpdf:setXY x="165" y="100" />
<fpdf:multiCell width="50" height="5" text="Ihr Ansprechpartner" border="{debug}" />
<fpdf:image x="165" y="105" height="30" filename="{f:uri.image(src: contactPersonImage.uid, treatIdAsReference: 1)}" />
<fpdf:setFont family="{textFontName}" style="{textFontStyle}" size="{textFontSize}" />
<fpdf:setTextColor hex="{textColor}" />
<fpdf:setXY x="165" y="135" />
<fpdf:multiCell width="50" height="5" text="{contactPersonImage.originalResource.title}" border="{debug}" />
</f:then>
<f:else>
<f:comment>No contact person assigned to email</f:comment>
</f:else>
</f:if>