Page 1 of 1

New Page Heading for Catagories

Posted: Sun Dec 18, 2005 5:02 am
by wxman
I don't know if I'm missing something obvious, but is there a way to make the page heading change with different catagories?
Like if you are looking at "News", then the page title would have a custom page heading to go with it. When you switch catagory, the page heading changes too.

Posted: Sun Dec 18, 2005 9:50 am
by Col. Kurtz
You can use the serendipity_event_categorytemplates - plugin, it allows you to define a seperate template for each category, so you can edit each category´s header.

Posted: Sun Dec 18, 2005 1:39 pm
by wxman
I didn't see that one. I'll give it a try. Thanks

Posted: Mon Dec 19, 2005 9:53 am
by garvinhicking
wxman: Actually the page title does change depending on the selected category. At least in the default template!

Regards,
Garvin

Posted: Mon Dec 19, 2005 3:45 pm
by wxman
Then maybe I'm doing something wrong. Here are the addresses of the two categories I set up for this author:

http://www.robinschone.com/serendipity/ ... oksignings

http://www.robinschone.com/serendipity/ ... ies/4-News

She wants one for book signing dates and info, and the other just for regular news. The pages are embedded, and I changed the index.php to whats_new.php for the default index page.
I'm using the Default template, with just a bit of editing done to it to make the right side, and posting, look the way she wants.
If I'm doing something wrong, please let me know before I really get things messed up!

Thanks

Posted: Mon Dec 19, 2005 8:13 pm
by garvinhicking
How exactly does your index.tpl template file look like? It should contain something like:

Code: Select all

<div id="serendipity_banner">
    <h1><a class="homelink1" href="{$serendipityBaseURL}">{$head_title|@default:$blogTitle}</a></h1>
    <h2><a class="homelink2" href="{$serendipityBaseURL}">{$head_subtitle|@default:$blogDescription}</a></h2>
</div>
The variable $head_title and $head_subtitle will be set by Serendipity's index.php file, if you select a category...so if your code looks similar, it should work?!

Regards,
Garvin

Posted: Tue Dec 20, 2005 4:05 am
by wxman
I checked the index.tpl for those lines, and it's right where it should be.
I also have the serendipity_event_categorytemplates plugin installed, but it really is vague about what to do with it.

Posted: Tue Dec 20, 2005 2:20 pm
by garvinhicking
I see that you're using a "whats_new.php" file instead of "index.php" which is the default -- so it can be that this is bypassing serendipity's index.php means to properly set $blog_title.

Look inside the index.php file, there should be several occurences of where blog_title is set. Can you verify if those get set correctly, or if this is bypassed somewhere/somehow?

If you care to give me temporary FTP access to your blog, I could also check exactly what's going on...

Best regards,
Garvin

Posted: Thu Dec 22, 2005 9:34 pm
by wxman
Sorry for the trouble, but I'm at a place that I can't get access to my server utilities. I can see the php code, and can copy it, so if you think it could help I can get copies of certian pages.
I didn't edit the index.php page at all. I did a search through the code for $blog_title and none were found.
Would all this be made easier if I just switched back to the index.php file instead of whats_new?

Posted: Thu Dec 22, 2005 9:41 pm
by garvinhicking
Yes, I suggest you to try it with the index.php file instead of whats_news.

BTW, you should search for "blog_title", not "$blog_title". :)

Regards,
Garvin

Posted: Thu Dec 22, 2005 9:56 pm
by wxman
OK I'm drawing a blank! Can I embed the page and still use index.php?

Posted: Thu Dec 22, 2005 9:58 pm
by garvinhicking
How about first getting that category thing working and then thinking about embedding?

Basically it should all work with a wrapper "whats_new.php" file, if you correctly specified it as indexFile option in the s9y configuration, and it's properly set within .htaccess and in the same path then the s9y index.php file...

Best regards,
Garvin

Posted: Fri Dec 23, 2005 4:23 am
by wxman
I did find this in the index.php:

Code: Select all

        $serendipity['head_title']    = $title[0];
        $serendipity['head_subtitle'] = $serendipity['blogTitle'];
I also switched the default back to index.php, but I left the link to her page as whats_new.php. When I look at the index.php version of it, the title still doesn't change. I checked the htaccess and it is being changed too.
I also realized that I am using the wrapper system to make the whats_new.php page work. Here's what the page code looks like after the heading and all the menu stuff:

Code: Select all

<?php
$_REQUEST['page'] = 'blog';
// Let serendipity generate our content:
ob_start();
require 'index.php';

$blog_data = ob_get_contents();
ob_end_clean();
echo '<link href="/serendipity/serendipity.css.php" rel="stylesheet" type="text/css" media="screen">'."\n";
echo $blog_data;
?>
    <p> </p>
    </td>
  </tr>
</table>
<img src="../../images/spacer.gif" alt="" width="15" height="1" hspace="0" vspace="0" border="0">
</body>
</html>
Maybe that's where I'm messing things up.
By the way, thanks for all the help.

Posted: Fri Dec 23, 2005 11:53 am
by garvinhicking
Hm, then it seems the 'head_title' code you pasted doesn't get properly executed in your system. You might need to add some debugging output there to see, if the categoryInfo array is filled?

I can help you further after the christmas days, then we can do some more debugging.

Regards,
Garvin

Posted: Fri Dec 23, 2005 2:36 pm
by wxman
Thanks Garvin. I'll keep working on it, but it's getting a bit busy here with Christmas an all. I hope you have a good holiday.

Tom