diff --git a/modules/frontend/journal/JournalFrontendModule.php b/modules/frontend/journal/JournalFrontendModule.php index b641294..b0060e1 100644 --- a/modules/frontend/journal/JournalFrontendModule.php +++ b/modules/frontend/journal/JournalFrontendModule.php @@ -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(); diff --git a/modules/frontend/journal/templates/journal_entry_teaser_example.tmpl b/modules/frontend/journal/templates/journal_entry_teaser_example.tmpl new file mode 100644 index 0000000..a6dbb80 --- /dev/null +++ b/modules/frontend/journal/templates/journal_entry_teaser_example.tmpl @@ -0,0 +1,25 @@ + + +

{{title}}

+{{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}} +

+ + {{image_description}} + + {{image_description}} +

+{{endIf}} +{{identifierContext=end;name=image_display_url}} +

+ {{writeParameterizedString=journal.publish_date;date=\{\{date_timestamp\}\}}}{{identifierContext=start;name=user_name}}, {{user_name}}{{identifierContext=end;name=user_name}} +

+{{text_short}} +{{writeString=wns.read_more}}