I have hidden various elements of the normal Plone front page via:
.section-front-page #portal-globalnav {
display: none;
}
Now, I want to add a globalnav to the bottom near the footer. I've considered a variety of approaches:
What is the best approach?
In Plone 4 and greater, you can register the globalnav viewlet as a content provider:
<adapter
name="globalnav"
for="*
zope.publisher.interfaces.browser.IDefaultBrowserLayer
*"
factory="plone.app.layout.viewlets.common.GlobalSectionsViewlet"
provides="zope.contentprovider.interfaces.IContentProvider"
/>
and then include it in your homepage template or main_template using:
<tal:block tal:replace="structure provider:globalnav"/>
The only on the front page bit is the tricky part. You could use your GS profile to mark the front page with a special, one-off interface and then use ZCML to register the plone.global_sections
viewlet for the IPortalFooter
manager for that context and only that context:
<browser:viewlet
name="plone.global_sections"
for="my.special.IFrontPage"
manager="plone.app.layout.viewlets.interfaces.IPortalFooter"
class="plone.app.layout.viewlets.common.GlobalSectionsViewlet"
permission="zope2.View"
/>
You could also use this to then register a dummy, empty plone.global_sections
viewlet for IPortalHead
instead of using display: none;
<browser:viewlet
name="plone.global_sections"
for="my.special.IFrontPage"
manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
class="my.special.EmptyViewlet"
permission="zope2.View"
/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With