Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions modules/frontend/journal/JournalFrontendModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ private function renderRecentJournalEntryTeasers($mJournalId, $iLimit) {
}
$oListTemplate = $this->constructTemplate('teaser_list');
$oTeaserTemplate = $this->constructTemplate('journal_entry_teaser');
foreach($oJournalEntries as $i => $oJournalEntry) {
foreach($oJournalEntries as $iIndex => $oJournalEntry) {
$oTemplate = clone $oTeaserTemplate;
// show image of first journal entry teaser if a template identifier 'image_display_url' exists.
if($oTemplate->hasIdentifier('image_display_url') && $i === 0) {
if($oTemplate->hasIdentifier('image_display_url')) {
$oTemplate->replaceIdentifier('index', $iIndex);
$oImage = $oJournalEntry->getImages(1)->getFirst();
if($oImage) {
$oDocument = $oImage->getDocument();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!--
Example of html for displaying first image of journal entry image gallery in teaser
Change (or add) the template "journal_entry_teaser.tmpl" in site/modules/frontend/journal/templates/journal_entry_teaser.tmpl
- use "IdentifierContext" for displaying image related content, if exists
- optionally use lessThan (if=<) condition within this context, to limit view of image to a specific number of entries (... 2=3)
For further information check JournalFrontendModule.php and Template related classes
-->

<h2><a href="{{link_to_detail}}" class="read_more" title="{{writeString=wns.read_more}}: „{{title}}“">{{title}}</a></h2>
{{identifierContext=start;name=image_display_url}}
// show the first image of journal gallery for first three entries, if they exist
{{if=<;1=\{\{index\}\};2=3}}
<p class="images">
<a href="{{link_to_detail}}" class="read_more" title="{{writeString=wns.read_more}}: {{title}}">
<img src="{{image_display_url}}" alt="{{image_description}}" width="{{image_width}}" height="{{image_height}}" />
</a>
<span class="legend">{{image_description}}</span>
</p>
{{endIf}}
{{identifierContext=end;name=image_display_url}}
<p class="journal_sub">
{{writeParameterizedString=journal.publish_date;date=\{\{date_timestamp\}\}}}{{identifierContext=start;name=user_name}}, {{user_name}}{{identifierContext=end;name=user_name}}
</p>
{{text_short}}
<a href="{{link_to_detail}}" class="read_more">{{writeString=wns.read_more}}</a>