diff --git a/pages/index/IndexHandler.php b/pages/index/IndexHandler.php index 5678a902a2..fa758ad2b0 100644 --- a/pages/index/IndexHandler.php +++ b/pages/index/IndexHandler.php @@ -60,6 +60,7 @@ public function index($args, $request) $this->setupTemplate($request); $router = $request->getRouter(); $templateMgr = TemplateManager::getManager($request); + $this->_setupAnnouncements($server, $templateMgr); if ($server) { // OPS: sections $sections = Repo::section()->getCollector()->filterByContextIds([$server->getId()])->getMany(); @@ -92,8 +93,6 @@ public function index($args, $request) 'authorUserGroups' => Repo::userGroup()->getCollector()->filterByRoleIds([\PKP\security\Role::ROLE_ID_AUTHOR])->filterByContextIds([$server->getId()])->getMany()->remember(), ]); - $this->_setupAnnouncements($server, $templateMgr); - $templateMgr->display('frontend/pages/indexServer.tpl'); event(new UsageEvent(Application::ASSOC_TYPE_SERVER, $server)); return; diff --git a/plugins/themes/default/styles/components.less b/plugins/themes/default/styles/components.less index f524d22533..11beb88a8f 100755 --- a/plugins/themes/default/styles/components.less +++ b/plugins/themes/default/styles/components.less @@ -392,7 +392,8 @@ } // Announcements -.cmp_announcements { +// Double class rule overrides .pkp_structure_main ul +.cmp_announcements.cmp_announcements { &:extend(.pkp_unstyled_list); margin-left: -@base; margin-right: -@base; diff --git a/templates/frontend/pages/indexServer.tpl b/templates/frontend/pages/indexServer.tpl index a5cd6d2e23..6e41e68f08 100644 --- a/templates/frontend/pages/indexServer.tpl +++ b/templates/frontend/pages/indexServer.tpl @@ -49,36 +49,7 @@ {/if} - {* Announcements *} - {if $numAnnouncementsHomepage && $announcements|@count} -
- -

- {translate key="announcement.announcements"} -

- {foreach name=announcements from=$announcements item=announcement} - {if $smarty.foreach.announcements.iteration > $numAnnouncementsHomepage} - {break} - {/if} - {if $smarty.foreach.announcements.iteration == 1} - {include file="frontend/objects/announcement_summary.tpl" heading="h3"} -
- {else} - - {/if} - {/foreach} -
-
- {/if} + {include file="frontend/objects/announcements_list.tpl" numAnnouncements=$numAnnouncementsHomepage} {* Additional Homepage Content *} {if $additionalHomeContent} diff --git a/templates/frontend/pages/indexSite.tpl b/templates/frontend/pages/indexSite.tpl index d6b3739987..bd589beab1 100644 --- a/templates/frontend/pages/indexSite.tpl +++ b/templates/frontend/pages/indexSite.tpl @@ -18,6 +18,8 @@ {/if} + {include file="frontend/objects/announcements_list.tpl" numAnnouncements=$numAnnouncementsHomepage} +

{translate key="context.contexts"}