Change site title after quick_install

Hey everyone, I'm currently wrestling with the inconsistency of registry vs. Zope title.

I believe the issue was mentioned before in this thread.

context.getSite().Title() retrieves the title I set with setTitle(), so far so good. However
context.getSite().unrestrictedTraverse('plone_portal_state').portal_title() retrieves the actual current site title that I'm trying to change, namely 'Plone site'.

Is there a way to change the site title that the website actually displays?

Not sure if you're talking about the title you see when you land on the front page.
That title is set by the page, not the global site title.
Regardless of what you set the site title to, the homepage will be influenced by the default page.

Please clarify further if I'm misunderstanding your query.

Ah, sorry if my post lead to misunderstandings.

What I mean is, I'm attempting to change the site title, the one that shows up in a browser tab. You can edit it in /@@site-controlpanel, the field in question is called "site_title".

Under what circumstance do you need to change it?
For example this something you want to change upon the installation of a addon?

Usually, 'those kind of settings' will be possible to set in an xml file in your product (if that is OK).

  • Sett a title in the control panel.
  • Then go to /portal_setup and export all the settings.
  • Search for the title you set among these files.
  • Copy that file to /profiles/default folder of your product.
  • Remove 'all the other lines not needed from the xml file'.

the file /profiles/default/properties.xml should probably have an entry similar to this:

<?xml version="1.0"?>
    <property name="title">My Company</property>
    <property name="description">Some description here</property>

What @espenmn says looks like the right answer, especially after re-reading your title which says "after quick_install".

Ah, I recently heard about the export functionality, I'm not too familiar with it so it wasn't my first instinct to rely on it. Doing it via XML is totally okay.

I've downloaded .tar, copied and customized the properties.xml and ran a quick install. Unfortunately nothing seems to have changed, the site is still called "Plone site" despite my edit in the properties.xml.

To ensure that it actually accepted my quick install, I even exported the new properties.xml, only to be met with an exact replica of the one that I copied in our file system. So, while it seems to accept the XML, it seems that it ignores the "title" property. Just to mess around, I attempted to rename it to "site_title", though that gave an error.

Am I doing something wrong? Are there steps involved I'm not paying attention to, or maybe alternate approaches?

I did a little digging. The correct place to put this is in registry.xml
I just created a complete working example here (the result will be a site with the title "Hello World":

1 Like

I've dabbled with the registry before, and although I suspected it might be relevant for the implementation, I didn't end up experimenting with it. After trying your suggestion, it ends up working like a charm. Thanks again for the help regarding this!