Remove — Plone site

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

I assume that the site title that you can configure within the control panel of Plone ("Site" settings I assume)

I can change to "." but then it becomes -> "page title — ."

I want to remove it completely. Seems like such a basic request... :frowning:

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 "—"

Do you know where this "—" text coming from?
Is there a template I can modify somewhere?

Github issue - https://github.com/plone/Products.CMFPlone/issues/2937

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

Sorry for the late reply.

Any way I can change this without editing source code?

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.

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>

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.

How does that change the title from Welcome to Plone - Plone site to just Welcome to Plone?

Sorry, I thought it was the other way around (that he just wanted the site title)

FANTASTIC :heart_eyes:

Thanks @tmassman :slight_smile:

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

No problem, I read your example again and again and thought I was missing something :wink:

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.

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?

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"

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.