schoelje
(Schoelje)
May 22, 2018, 8:51am
1
Using Plone 5.0.8
I have a multilingual site and I was wondering if it is possible to hide the language in the page titles.
The News page, for example, has this title:
"News - English"
but I'd simply like it to be:
"News"
The structure is:
LRF with "English" as title > News
Is that possible?
erral
(Mikel Larreategi)
May 22, 2018, 9:34am
2
The reason behind it is that Plone shows the nearest navigation root's title on the <title>
tag. The text "English" comes from the title of the LRF, you can edit it from http://yoursite.com/en/edit
To remove it, you should override the title viewlet and remove it from there:
return id(self) * 16
@property
@deprecate("Use site_url instead. " +
"ViewletBase.portal_url will be removed in Plone 4")
def portal_url(self):
return self.site_url
def update(self):
self.portal_state = getMultiAdapter((self.context, self.request),
name=u'plone_portal_state')
self.site_url = self.portal_state.portal_url()
self.navigation_root_url = self.portal_state.navigation_root_url()
def render(self):
# defer to index method, because that's what gets overridden by the
# template ZCML attribute
return self.index()
def index(self):
raise NotImplementedError(
schoelje
(Schoelje)
May 22, 2018, 10:07am
3
Thank you for your quick reply. Unfortunately, that is a lot more complex than I had hoped and goes a lot further than my knowledge on Plone reaches.
Thanks anyway.
For anybody who's interested in overriding viewlets, I found this: https://docs.plone.org/develop/plone/views/more_view_examples.html
1 Like