private function renderEntry(JournalEntry $oEntry, Template $oEntryTemplate, $bIsAjax = false)
 {
     $oCommentQuery = JournalCommentQuery::create()->excludeUnverified();
     $oEntryTemplate->replaceIdentifier('journal_title', $oEntry->getJournal()->getName());
     $oEntryTemplate->replaceIdentifier('slug', $oEntry->getSlug());
     $oEntryTemplate->replaceIdentifier('name', $oEntry->getSlug());
     $oEntryTemplate->replaceIdentifier('user_name', $oEntry->getUserRelatedByCreatedBy()->getFullName());
     $oEntryTemplate->replaceIdentifier('id', $oEntry->getId());
     $oEntryTemplate->replaceIdentifier('date', LocaleUtil::localizeDate($oEntry->getPublishAtTimestamp()));
     $oEntryTemplate->replaceIdentifier('title', $oEntry->getTitle());
     $oEntryTemplate->replaceIdentifier('comment_count', $oEntry->countJournalComments($oCommentQuery));
     // Manager in link has to be set manually for the case when it's called asynchroneously in preview
     $sDetailLink = LinkUtil::link($oEntry->getLink($this->oPage), $this->bIsPreview ? 'PreviewManager' : 'FrontendManager');
     $oEntryTemplate->replaceIdentifier('link', LinkUtil::absoluteLink($sDetailLink), null, LinkUtil::isSSL());
     $oEntryTemplate->replaceIdentifier('detail_link_title', TranslationPeer::getString('journal_entry.add_comment_title', null, null, array('title' => $oEntry->getTitle())));
     if ($oEntryTemplate->hasIdentifier('text')) {
         $oEntryTemplate->replaceIdentifier('text', RichtextUtil::parseStorageForFrontendOutput($oEntry->getText()));
     }
     if ($oEntryTemplate->hasIdentifier('text_short')) {
         $oEntryTemplate->replaceIdentifier('text_short', RichtextUtil::parseStorageForFrontendOutput($oEntry->getTextShort()));
     }
     if ($this->oEntry !== null && $this->oEntry == $oEntry) {
         $oEntryTemplate->replaceIdentifier('current_class', ' class="current"', null, Template::NO_HTML_ESCAPE);
     }
     if ($oEntryTemplate->hasIdentifier('tags')) {
         $aTagInstances = TagInstanceQuery::create()->filterByModelName('JournalEntry')->filterByTaggedItemId($oEntry->getId())->joinTag()->find();
         foreach ($aTagInstances as $i => $oTagInstance) {
             if ($i > 0) {
                 $oEntryTemplate->replaceIdentifierMultiple('tags', ', ', null, Template::NO_NEWLINE | Template::NO_NEW_CONTEXT);
             }
             $oEntryTemplate->replaceIdentifierMultiple('tags', $oTagInstance->getTag()->getReadableName(), null, Template::NO_NEW_CONTEXT | Template::NO_NEWLINE);
         }
     }
     if ($oEntryTemplate->hasIdentifier('journal_comments')) {
         $oEntryTemplate->replaceIdentifier('journal_comments', $this->renderComments($oEntry->getJournalComments($oCommentQuery), $oEntry, $oEntry === $this->oEntry));
     }
     if ($oEntryTemplate->hasIdentifier('journal_gallery') && $oEntry->countJournalEntryImages() > 0) {
         $oEntryTemplate->replaceIdentifier('journal_gallery', $this->renderGallery($oEntry));
     }
     if ($this->bIsPreview && !$bIsAjax) {
         $oEntryTemplate = TagWriter::quickTag('div', array('class' => 'journal_entry-container filled-container', 'data-entry-id' => $oEntry->getId(), 'data-is-not-shown' => $oEntry->isNotShown(), 'data-template' => $oEntryTemplate->getTemplateName()), $oEntryTemplate);
     }
     return $oEntryTemplate;
 }