Page 1 of 1
Rename the Title
Posted: Fri Jul 28, 2006 10:34 am
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
Re: Rename the Title
Posted: Fri Jul 28, 2006 1:48 pm
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
Posted: Sat Jul 29, 2006 4:01 pm
by Elaine
This is a great idea!
And a good solution from Garvin.
I think I might do this too.
Posted: Mon Jul 31, 2006 1:49 pm
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!
Posted: Mon Jul 31, 2006 1:52 pm
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
Posted: Mon Jul 31, 2006 2:14 pm
by lordcoffee
Thanks again!
but I can't find any
"template's config.inc.php"?
Lordcoffee
Posted: Mon Jul 31, 2006 2:30 pm
by garvinhicking
Hi!
If that file does not exist, just create it
Regards,
Garvin
Posted: Mon Jul 31, 2006 3:10 pm
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?
Posted: Tue Aug 01, 2006 8:21 pm
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
Posted: Wed Aug 30, 2006 7:29 pm
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?
Posted: Wed Aug 30, 2006 7:33 pm
by garvinhicking
Hi Buzz!
Your question is not really related to this thread.
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
Posted: Wed Aug 30, 2006 8:09 pm
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!
Posted: Wed Aug 30, 2006 8:16 pm
by garvinhicking
Hi!
Exactly, ther ein that place you can insert the text you want to have!
Have fun!
Best regards,
Garvin