Home : Products : DBMan : Customization :

Products: DBMan: Customization: $rec{title} page title for mh=1 - would really like page title from record for search engine optimization: Edit Log

Here is the list of edits for this post
$rec{title} page title for mh=1 - would really like page title from record for search engine optimization
The one thing that I just can't figure out how to do with dbman that still bothers me is that I would really like to pull the record title from the record when max hits = 1.

However I cannot for the life of me figure out how to do this. This means that while many of my records are listed in google, the page title is always generic and neither good for my site being found in google or good for those searching. (if the record title is "18 inch brass clock", the page title when the record is pulled up by visitors or google is still "my site" for everything. There must be a way to pull the record title into the page title, no?)

Can anyone help?

This post from JPDeni back in 1999 seems to be exactly what I want to do:

http://gossamer-threads.com/perl/gforum/gforum.cgi?do=post_view_threaded;post=57592;sb=post_latest_reply;so=ASC;

Quote:
If you're using the "short/long" display, here's what you do.

In sub html_view_success, instead of

Code

$page_title = "Search Results";


use

Code

if (($db_total_hits == 1) or ($maxhits == 1)) {
%rec = &array_to_hash(0, @hits);
$page_title = "$rec{'Title'} in $rec{'Year'}";
}
else {
$page_title = "Search Results";
}


You can put as many fields into the $page_title variable as you want.

Notice I added the word "in" there before the year variable to test it, and now all that is returned for this case is "in" - it simply is not fetching the rec varialbes.

Any ideas?

Last edited by:

Jeff-C: Aug 11, 2005, 2:46 AM

Edit Log: