Rename the Title

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
lordcoffee
Regular
Posts: 308
Joined: Tue Nov 29, 2005 10:22 pm
Location: Munich - Germany
Contact:

Rename the Title

Post by lordcoffee »

Hi,
I was using two blogs a long long time but now want to use only one, because I have not that much time. The Problem is that I have two domains (one for private and family things and the other for work and hobby). Long story short:

When I enter www.domain01.de the Blogtitle will be domain01.de and if I enter www.domain02.de the blogtitle will be domain02.de. Is that possible?

Thanks Lordcoffee
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Rename the Title

Post by garvinhicking »

Hi!

That's possible. Even within your template only.

You need to enable "Autodetect HTTP Host" in your s9y configuration to make s9y "lock on" the new host. Then in your index.tpl you can use something like:

Code: Select all

{if $serendipityBaseURL == 'http://www.domain01.de'}
Domain1
{else}
Domain2
{/if}
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Elaine
Regular
Posts: 27
Joined: Thu Jul 20, 2006 10:21 pm

Post by Elaine »

This is a great idea!
And a good solution from Garvin.

I think I might do this too.
lordcoffee
Regular
Posts: 308
Joined: Tue Nov 29, 2005 10:22 pm
Location: Munich - Germany
Contact:

Post by lordcoffee »

Thanks Garvin!

But this was not exactly what I was searching for. I want to change the Blogtitle not the BrowserTitle. Here a detailed example:

If you enter www.postscriptfreunde.de your come to my "Hobby"Blog and the BlogTitle is called "postscriptfreunde.de - Jeder hat das Recht auf meine Meinung!".

Now If you enter www.taeglichanders.de you come to my FamilyBlog. What I want to do is to redirect the taeglichanders.de domain to postscriptfreunde, so that they're the same page but I want so let s9y recognize which url you're using to arrive my Blog. So if you enter www.taeglichanders.de the Blogtitle should be "taeglichanders.de - Jeder hat das Recht auf meine Meinung!". Is that also possible?

Thanks again!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

For that you will need to create a plugin that changes $serendipity['blogTitle'] by listening on the frontend_configure hook.

It might also do the trick if you put this into your template's config.inc.php:

Code: Select all

if ($_SERVER['HTTP_HOST'] == 'domain1.de') {
  $serendipity['blogTitle'] = 'Domain1';
}
But it might be too late at this point since all event plugins are then already loaded. But not many event plugins use the blogtitle, so it might not matter at all.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
lordcoffee
Regular
Posts: 308
Joined: Tue Nov 29, 2005 10:22 pm
Location: Munich - Germany
Contact:

Post by lordcoffee »

Thanks again! :D

but I can't find any "template's config.inc.php"?

Lordcoffee
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

If that file does not exist, just create it :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
lordcoffee
Regular
Posts: 308
Joined: Tue Nov 29, 2005 10:22 pm
Location: Munich - Germany
Contact:

Post by lordcoffee »

O.K. I've created the config.inc.php with this inside:

if ($_SERVER['HTTP_HOST'] == 'http://www.postscriptfreunde.de') {
$serendipity['blogTitle'] = 'JustTesting';
}

Nothing happens. Should I insert some code inside the index.tpl so it can "communicate" with the config.inc.php?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Make a dump of $_SERVER['HTTP_HOST'] and you will see that it does NOT contain the "http://" string, thus your if structure would never return true :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Buzz
Regular
Posts: 20
Joined: Wed Aug 30, 2006 7:25 pm

Post by Buzz »

I am having quite a difficult time with this.

I want to change the head title. As if in html, it'd be:

<head>
<title>here's my page</title>
</head>

But I want to do this on the main/all of the Serendipity weblog pages.

I tried what has been posted here and nothing works.

Any simpler, or more directed way of doing this? Please?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi Buzz!

Your question is not really related to this thread. :-D

You can edit the way of the <title> in the "index.tpl" file of your serendipity template. If your template directory doesnt have that file, copy it over frmo templates/default/index.tpl

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Buzz
Regular
Posts: 20
Joined: Wed Aug 30, 2006 7:25 pm

Post by Buzz »

Garvin,

Thank you so much. Finding that index.tpl file was like finding a contact lens in a swimming pool. I would've never thought to look in templates/default/

So I assume I remove the

{$head_title|@default:$blogTitle} {if $head_subtitle} - {$head_subtitle}{/if}

completely from between the <title> </title> and just type in what I want?

I'm sorry this doesn't relate to the previous topic. It looked like it might to me. I'm not real good at PHP. Obviously.

***
By the way, that worked perfectly. Thanks again!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Exactly, ther ein that place you can insert the text you want to have! :)

Have fun!

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply