ally
(Ally O)
August 14, 2019, 9:27am
1
How does one remove "— Plone site" that suffixes page title?
Seems in settings Plone insists on non empty string for a plone site...
Version Overview
Plone 5.2.0 (5207)
CMF 2.4.0
Zope 4.1.1
Python 3.7.4 (default, Jul 17 2019, 23:33:46) [GCC 6.3.0 20170516]
PIL 6.1.0 (Pillow)
WSGI: On
Server: waitress 1.3.0
zopyx
(Andreas Jung)
August 14, 2019, 11:14am
3
I assume that the site title that you can configure within the control panel of Plone ("Site" settings I assume)
ally
(Ally O)
August 14, 2019, 4:12pm
4
I can change to "." but then it becomes -> "page title — ."
I want to remove it completely. Seems like such a basic request...
davilima6
(Davi Lima)
August 14, 2019, 9:40pm
5
Please open an issue so that field becomes optional: https://github.com/plone/Products.CMFPlone/issues/new
For now you could go with an invisible character but you'd still get the symbol "—"
ally
(Ally O)
August 15, 2019, 2:30am
6
Do you know where this "—" text coming from?
Is there a template I can modify somewhere?
ally
(Ally O)
August 15, 2019, 2:32am
7
tmassman
(Thomas Massmann #BlackLivesMatter)
August 15, 2019, 6:52am
8
It's coming from the title viewlet: https://github.com/plone/plone.app.layout/blob/master/plone/app/layout/viewlets/common.py#L90 and the template used is https://github.com/plone/plone.app.layout/blob/master/plone/app/layout/viewlets/title.pt .
You could customize this using jbot to something like this (using page_title
instead of the generated site_title
):
<title tal:content="structure view/page_title">Site Title</title>
2 Likes
ally
(Ally O)
August 29, 2019, 7:06am
9
Sorry for the late reply.
Any way I can change this without editing source code?
mtrebron
(Norbert )
August 29, 2019, 7:44am
10
You could use an approach similar to the one described here in section 2:
https://docs.plone.org/adapt-and-extend/remove-welcome-section.html#duplicating-theme-and-removing-line-of-code
This involves modifying the theme of your site, the solution given by @tmassman is more straightforward.
espenmn
(Espen)
August 29, 2019, 7:58am
11
If you have a diazo theme, you could remove the line:
<replace css:theme="title" css:content="title" />
And then 'hardcode' it in your theme's index.html file (so the start would looks something like this):
<!doctype html>
<html>
<head>
<title>My Company</title>
tmassman
(Thomas Massmann #BlackLivesMatter)
August 29, 2019, 7:58am
12
If you already have a custom theme: https://training.plone.org/5/theming/theme-package-4.html?highlight=z3c.jbot#overriding-a-plone-template
You can do it TTW (Through the web) too:
To override them from the ZMI, you can go to ./portal_view_customizations
. But this is very limited and does not work for all views.
I tried and it does work for the title viewlet. So in the ZMI (https://your-plonesite/manage ) go to portal_view_customizations
. Then search for plone.htmlhead.title
, click the link and edit the template. Click on save changes
and your title should be changed. Note that if you use some sort of caching you have to invalidate this.
To remove your changes later go back to portal_view_customizations
, navigate to the Contents
tab, select your customized template and delete it.
tmassman
(Thomas Massmann #BlackLivesMatter)
August 29, 2019, 8:01am
13
How does that change the title from Welcome to Plone - Plone site
to just Welcome to Plone
?
espenmn
(Espen)
August 29, 2019, 8:13am
14
Sorry, I thought it was the other way around (that he just wanted the site title)
ally
(Ally O)
August 29, 2019, 8:19am
15
FANTASTIC
Thanks @tmassman
ZMI (/manage) ->
<title tal:content="structure view/site_title">Site Title</title>
to
<title tal:content="structure view/page_title">Site Title</title>
I'm still super scared to edit stuff in there, but this was very simple.
I am getting interested in the templates a bit now.
Thank you all.
1 Like
tmassman
(Thomas Massmann #BlackLivesMatter)
August 29, 2019, 9:10am
16
No problem, I read your example again and again and thought I was missing something
tmassman
(Thomas Massmann #BlackLivesMatter)
August 29, 2019, 9:12am
17
Yeah, you should not use it too often, as it's hard to debug especially when the underlying view class changes in the future. The better solution would be to add it to an integration or theme package.
weberc
(Christoph Weber)
September 6, 2019, 1:50pm
18
Can I replace the title just on the start page?
My title looks like
<title>International Cooperative Research — XYZ</title>
because the standard page that shows up as a homepage is called "International Cooperative Research".
As a result, every bookmark or tab has this cumbersome name instead of just "XYZ".
For all the other pages "Pagetitle — XYZ" is ok, but I want to get rid of it on the start page.
Can I replace this in my rules.xml?
espenmn
(Espen)
September 6, 2019, 2:11pm
19
Yes, probably like this:
In your index.html file
<title>XYZ</title>
Then, you put a condition around title in your rules.xml, maybe something like this:
<rules css:if-not-content=".section-front-page">
<replace css:theme="title" css:content="title" />
</rules>
Or just drop the part in index html and add another: "if-content"
weberc
(Christoph Weber)
September 10, 2019, 2:35pm
20
Thank you!
I had to replace my rules.xml with a modified copy of the barceloneta rules.xml instead of importing it, but now it works.