simple title for portal home page

6 messages Options
Embed this post
Permalink
atrom99 () simple title for portal home page
Reply Threaded More More options
Print post
Permalink
Hi, I think this is probably an easy one for someone out there, but I can't seem
to figure it out.  

My plone site has a site title and each page has a title.  When each page is rendered,
the actual title of the page is "<pageTitle> -- <siteTitle>", which is mostly great.  However
I'd love it if the title of the sites home/root page was just "<siteTitle>" is there some way to
make that happen ?

Thanks very much !

PS: My setup is
    * Plone 3.0.5
    * CMF-2.1.0
    * Zope (Zope 2.10.5-final, python 2.4.3, linux2)
    * Python 2.4.3 (#1, Jul 27 2009, 17:57:39) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]
    * PIL 1.1.6
Ricardo Alves-2 () Re: simple title for portal home page
Reply Threaded More More options
Print post
Permalink
atrom99 wrote:

> Hi, I think this is probably an easy one for someone out there, but I
> can't
> seem
> to figure it out.
>
> My plone site has a site title and each page has a title. When each
> page is
> rendered,
> the actual title of the page is "<pageTitle> -- <siteTitle>", which is
> mostly great. However
> I'd love it if the title of the sites home/root page was just
> "<siteTitle>"
> is there some way to
> make that happen ?
>
> Thanks very much !
>

The best would be to override the plone.htmlhead.title viewlet, which is
implemented at plone.app.layout. If you need to know more on how to
override viewlets, check the following documents:

http://plone.org/documentation/tutorial/customization-for-developers/viewlets/

http://plone.org/documentation/tutorial/customizing-main-template-viewlets


Ricardo

--
Ricardo Alves <[hidden email]>
Eurotux <http://www.eurotux.com>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
atrom99 () Re: simple title for portal home page
Reply Threaded More More options
Print post
Permalink

Ricardo Alves-2 wrote:
The best would be to override the plone.htmlhead.title viewlet, which is
implemented at plone.app.layout. If you need to know more on how to
override viewlets, check the following documents:
Thanks very much for the pointer, Ricardo.  After I educated myself
about viewlets a bit, and dove way down into the code, I of course
found that there was already some special-casing to do exactly what I wanted.

The relevent code in TitleViewlet.render() looks like:

        if page_title == portal_title:
            return u"<title>%s</title>" % (escape(portal_title))

so all I had to do was make the page title exactly the same as the portal title, et voila.

But thanks again, at least I know a little be more about how this works now!
ajung () Re: simple title for portal home page
Reply Threaded More More options
Print post
Permalink
And with each minor upgrade to repeat this procedure over and over again? Sorry, this is not the right way for doing customizations. Never ever touch the Plone core code for the purpose of customizations.

-aj

atrom99 wrote:

The relevent code in TitleViewlet.render() looks like:

        if page_title == portal_title:
            return u"<title>%s</title>" % (escape(portal_title))

so all I had to do was make the page title exactly the same as the portal title, et voila.

atrom99 () Re: simple title for portal home page
Reply Threaded More More options
Print post
Permalink

ajung wrote:
And with each minor upgrade to repeat this procedure over and over again? Sorry, this is not the right way for doing customizations. Never ever touch the Plone core code for the purpose of customizations.

-aj
Sorry to be unclear AJ, but I'm saying that the special-casing was built in to the default code.  I didn't have to touch it.   Now I just need to figure out how to get the home page to not show it's "title" as an h1 header, but i'm sure I can do that with css somewhere ...
Daner () Re: simple title for portal home page
Reply Threaded More More options
Print post
Permalink
In reply to this post by ajung

ajung wrote:
And with each minor upgrade to repeat this procedure over and over again? Sorry, this is not the right way for doing customizations. Never ever touch the Plone core code for the purpose of customizations.

-aj

atrom99 wrote:

The relevent code in TitleViewlet.render() looks like:

        if page_title == portal_title:
            return u"<title>%s</title>" % (escape(portal_title))

so all I had to do was make the page title exactly the same as the portal title, et voila.

I try to stay away from touching the core code at all. i find i screw it up more often than not.