[opencms-dev] get item count with contentloop

Thomas Decher thomas.decher at tomdigital.de
Thu Jan 27 17:45:50 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, there's another way integrated in cms:contentinfo, very useful for
list-paging, too.
I just sent a quickly edited snippet from an existing template. Interesting are
the contentInfo elements...

<cms:contentload collector="allInSubTreePriorityDateDesc (or whatever but
singleFile)" param="Path|Type" preload="true">
	<cms:contentinfo var="info"/>
	<c:if test="${! info.emptyResult}">
		<ul>
			<cms:contentload pageIndex="${pageIndex}" pageSize="${param.itemsPerPage}">
			<cms:contentinfo var="contentInfo" />
			<cms:contentaccess var="contentItem"/>

			<!-- Loop of all Elements -->
				<li>$contentItem['Element']</li>
			<cms:contentload>
		</ul>

<!-- information about the collected content -->
result size: ${contentInfo.resultSize}
page size: ${contentInfo.pageSize
page count: ${contentInfo.pageCount}
page index: ${contentInfo.pageIndex}

${contentInfo.pageNavStartIndex}								
${contentInfo.pageNavEndIndex}					        ${contentInfo.pageNavLength}

		<a href="?pageIndex=${contentInfo.pageIndex+1}">next Page</a>

	</c:if>
</cms:contentload>



Kind regards

Thomas Decher

- -- 

tom digital GmbH
Thomas Decher
Hammerbrookstrasse 93
20097 Hamburg, Germany

Telefon: +49.40.254048-10
Fax:     +49.40.254048-40

E-Mail: thomas.decher at tomdigital.de
________________________________________________________________________________

tom digital GmbH

Geschäftsführer / Managing Director: Thomas Heisterhagen
Eingetragen beim / registered at: Amtsgericht Hamburg HRB 110797

Diese E-Mail einschliesslich ihrer Anlagen ist vertraulich und nur fuer
den Adressaten bestimmt. Wenn Sie nicht der vorgesehene Empfaenger sind,
bitten wir Sie, dieses E-Mail mit Anlagen unverzueglich vollstaendig zu
loeschen und uns umgehend zu benachrichtigen.

Dieses Problem ließe sich mit Verschlüsselung sehr leicht umgehen. Für diese
E-Mail-Adresse ist ein PGP-Schlüssel, die ID lautet 0xBDCC86D6, auf den gängigen
Schlüsselservern verfügbar.

This e-mail and its attachments are strictly confidential and are
intended solely for the attention of the person to which it is
addressed. If you are not the intended recipient of this e-mail, please
delete it including its attachments immediately and inform us
accordingly.

This problem can be dealt with simply by encryption. A PGP-key, the id is
0xBDCC86D6, for this email-account is available on the established key servers.
________________________________________________________________________________
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1BoT4ACgkQJ51ior3MhtZqUQCeLSbiH5hb98j/4uXewD/z8UrO
7+IAnj6vE6icvzicttaro0goZMJggAYC
=DCti
-----END PGP SIGNATURE-----



More information about the opencms-dev mailing list