{namespace pw=PwTeaserTeam\PwTeaser\ViewHelpers}
<f:layout name="default" />

<f:section name="main">
	<div><strong>{f:count(subject:'{pages}')}</strong> inventari presenti</div>

	<f:if condition="{f:count(subject:'{pages}')}">
		<f:then>
			<pw:widget.paginate objects="{pages}" as="pageObject" configuration="{itemsPerPage: 5, insertAbove: 0, insertBelow: 1}">
				<ul class="base_list news_list">
					<f:for each="{pageObject}" as="page">
						<li>
							<a href="fileadmin/redazione/inventari/Alessandria_OP_SGiacomo_L.JPG" class="menuRow1" title="Veduta dell'Ospedale psichiatrico San Giacomo di Alessandria">
								<img src="fileadmin/redazione/inventari/Alessandria_OP_SGiacomo_S.jpg" width="100" height="100"   alt="">
							</a>
							<script>$(".menuRow1").colorbox({rel:'menuRow1'});</script>
							<h4>{page.title}</h4>

							<f:if condition="{settings.loadContents}">
								<strong>First image (of content elements, column 0)</strong>: <br />
								<pw:getContent contents="{page.contents}" as="content" cType="image" index="0">
									<f:image src="{content.imageFiles.0.url}" alt="{content.imageFiles.0.title}" maxWidth="200" maxHeight="200" />
								</pw:getContent>
								
								<pw:getContent contents="{page.contents}" as="content" colPos="0" cType="text">
									<f:format.html>{content.bodytext}</f:format.html>
								</pw:getContent>
								

								<pw:getContent contents="{page.contents}" as="content" colPos="100" cType="uploads">
									<f:debug title="Debug of MyArray">{content}</f:debug>***
									<f:for each="{content.image}" as="image" iteration="iterator">
										<f:if condition="{iterator.isFirst} == 1">
											<f:image src="{image.uid}" treatIdAsReference="1" width="400c" height="100c" />
										</f:if>
									</f:for>
								</pw:getContent>
								
							</f:if>

						</li>
					</f:for>
				</ul>
			</pw:widget.paginate>
		</f:then>
		<f:else>
			<em>Nessun inventario presente.</em>
		</f:else>
	</f:if>
</f:section>