Мне понравились оба предложения, но я закончил тем, что сделал следующее (потому что я не мог видеть, как сделать все, что я хотел с другими предложениями):
<browser:viewlet
name="trueblade.phoenix.footer2"
manager="plone.app.layout.viewlets.interfaces.IPortalFooter"
class=".footer2.MyGlobalSectionsViewlet"
template="footer2.pt"
permission="zope2.View"
/>
С footer2.py вот так (на подкласс и ничего больше):
from plone.app.layout.viewlets.common import GlobalSectionsViewlet
class MyGlobalSectionsViewlet(GlobalSectionsViewlet):
pass
И footer2.pt вот так (все то же самое, кроме идентификатора CSS):
<tal:sections tal:define="portal_tabs view/portal_tabs"
tal:condition="portal_tabs"
i18n:domain="plone">
<h5 class="hiddenStructure" i18n:translate="heading_sections">Sections</h5>
<ul id="footer2"
tal:define="selected_tab python:view.selected_portal_tab"
><tal:tabs tal:repeat="tab portal_tabs"
><li tal:define="tid tab/id"
tal:attributes="id string:portaltab-${tid};
class python:selected_tab==tid and 'selected' or 'plain'"
><a href=""
tal:content="tab/name"
tal:attributes="href tab/url;
title tab/description|nothing;">
Tab Name
</a></li></tal:tabs></ul>
</tal:sections>
И CSS вот так (для отображения footer2 натолько на первой странице):
#footer2 {
display: none;
}
.section-front-page #footer2 {
display: block;
margin: 1em;
}
И, конечно же, копия стилей нижнего колонтитула по умолчанию для нижнего колонтитула2:
#footer2 {
clear: both;
font-size: 80%;
background: #ddd;
/* ensure top navigation dont touches portlets, content etc.. #10491 */
margin: 0 0 1em 0;
text-align: center;
}
#footer2 li {
}
#footer2 li a {
display: inline-block;
padding: 0.5em 1em 2em 1em;
background: #ddd;
min-width: 6em;
white-space: normal;
/*TODO: Once we have removed the whitespace from the nav template, this can be put back*/
/*border-bottom: 0.1em solid White;*/
border-right: 0.1em solid white;
}
#footer2 .selected a,
#footer2 a:hover {
background: #205c90;
color: White;
}
#footer2 .selected a:hover {
background: #ddd;
color: #205c90;
}