New Page Heading for Catagories

Having trouble installing serendipity?
Post Reply
wxman
Regular
Posts: 19
Joined: Tue Nov 22, 2005 7:05 pm

New Page Heading for Catagories

Post 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.
Col. Kurtz
Regular
Posts: 450
Joined: Thu May 26, 2005 10:43 am
Location: Bonn, Germany
Contact:

Post 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.
Marc
wxman
Regular
Posts: 19
Joined: Tue Nov 22, 2005 7:05 pm

Post by wxman »

I didn't see that one. I'll give it a try. Thanks
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

wxman: Actually the page title does change depending on the selected category. At least in the default template!

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/
wxman
Regular
Posts: 19
Joined: Tue Nov 22, 2005 7:05 pm

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# 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/
wxman
Regular
Posts: 19
Joined: Tue Nov 22, 2005 7:05 pm

Post 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.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# 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/
wxman
Regular
Posts: 19
Joined: Tue Nov 22, 2005 7:05 pm

Post 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?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# 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/
wxman
Regular
Posts: 19
Joined: Tue Nov 22, 2005 7:05 pm

Post by wxman »

OK I'm drawing a blank! Can I embed the page and still use index.php?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# 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/
wxman
Regular
Posts: 19
Joined: Tue Nov 22, 2005 7:05 pm

Post 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.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# 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/
wxman
Regular
Posts: 19
Joined: Tue Nov 22, 2005 7:05 pm

Post 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
Post Reply