[TYPO3-mvc] Create new object to access its table, class

Jochen Rau jochen.rau at typoplanet.de
Mon Dec 14 14:24:35 CET 2009


Hi Eat,

schrieb Eat Dimanche:
> Hi there,
>
> In blogexample I have looked at post table, there is the relative field
> is called relatedPosts its self. In index template I would like to list
> also this filed ("relatedPosts") value, but I could not. I know it is an
> object, how can I list this in my template? Is it possible or not?

Just copy the HTML-code from the Post/show.html to Post/index.html

		<f:if condition="{post.relatedPosts}">
			<div>Related posts:</div>
			<ul class="tx-blogexample-related">
				<f:for each="{post.relatedPosts}" as="relatedPost">
					<li>
						<f:link.action action="show" controller="Post" arguments="{post: 
relatedPost, blog: post.blog}">{relatedPost.title}</f:link.action>
					</li>
				</f:for>
			</ul>
		</f:if>

You also have to specify related posts in the backend.

Regards
Jochen


-- 
Every nit picked is a bug fixed

 >
 >
 > Regards,
 > Dimanche


More information about the TYPO3-project-typo3v4mvc mailing list