Part of the EllisLab Network
pMachine Pro has been replaced by ExpressionEngine, our full featured web publishing solution. Please consider upgrading.
You can download pMachine Pro here: Download pMachine Pro  |  Download Language Packs
   
 
Keywords in Title tag of search results page
Posted: 04 July 2005 01:00 PM   [ Ignore ]  
Summer Student
Total Posts:  13
Joined  2005-02-26

I would like to display the actual search string (%%keywords%%) in the title tag of the search results page.

For example, when somebody searches for “bla bla bla”, the title of the search results page will be “Search results for: bla bla bla”.

Anybody has (or can suggest) a hack for this?

Thanks! smile
Miroslav

Profile
 
 
Posted: 04 July 2005 01:50 PM   [ Ignore ]   [ # 1 ]  
Research Assistant
RankRankRank
Total Posts:  549
Joined  2005-01-05

scrap that sorry.  thought you were talking about EE.

 Signature 

Celebrating again soon.

Profile
 
 
Posted: 05 July 2005 03:50 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  13
Joined  2005-02-26

I am sure some clever programmer can find a way (Chris already showed how to grab category names. There must be a solution for search terms, too)!

The reason this is important to me is because I am using pre-defined search URLs instead of categories. This allows me to have as many sub-categories as I want and file posts under more than one (sub)category. Total freedom! smile

At the same time, I would like to gain better rankings in the search engines for my (sub)category pages and the title tag is the most important thing to have your keywords in. So, if I could get my keywords (the actual search phrase) in the title tag, my search engine rankings would improve as a result.

Anybody has an idea?

Miroslav

Profile
 
 
Posted: 05 July 2005 02:10 PM   [ Ignore ]   [ # 3 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9853
Joined  2002-06-19

What do your URLs look like?  You might be able to pull the search terms for display from there.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 05 July 2005 02:22 PM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  13
Joined  2005-02-26

Here’s how the URLs look like:

http://www.domain-name.com/page.php?keywords=keyword1+keyword2+keyword3

Profile
 
 
Posted: 05 July 2005 08:28 PM   [ Ignore ]   [ # 5 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9853
Joined  2002-06-19

Try something like:

<title><?php echo str_replace("+", " ", $_GET['keywords']); ?></title>

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 06 July 2005 01:52 AM   [ Ignore ]   [ # 6 ]  
Summer Student
Total Posts:  13
Joined  2005-02-26

So simple, so elegant… and it works (alghouth only on the first page of search results, not on the subsequent ones, but that’s all I need, anyway)! Thank you, thank you, thank you! smile

I suppose the same could be used in other places on the page, too (e.g. the PREV-NEXT navigation)?

Thank you, Chris, again!

Miroslav

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 233, on December 18, 2007 12:04 AM
Total Registered Members: 66459 Total Logged-in Users: 0
Total Topics: 84844 Total Anonymous Users: 0
Total Replies: 455284 Total Guests: 19
Total Posts: 540128    
Members ( View Memberlist )
Newest Members:  stephenhfoxysaxAtosheviboyjbcobbsOut_ThereChrisClowerstevelovePhoenix Firstgoyoq
Active Members: