Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#26 11-11-2003 19:25:43

Lisaweb
Member
From: CA
Registered: 04-21-2003
Posts: 417

Re: Product/category/page Name In Page Title

From looking at the code, it doesn''t seem correct, but some of it seems to be truncated.

This is what you should have, starting from line 327 in ste_exec.pl:


Code:

#########
######### Display the site layout.  This is done for both regular
######### pages and forms.
#########

$element_id = "$page_id";

if ($page_id =~ /^ste_nolay_/) {

&display_print($page_id);

} else {

########
######## Mod for metatags, based on:  
######## http://forum.kryptronic.com/viewtopic.php?id=4548
########

$page_title = "";

if ($fd_pg eq "ste_cat") {

$dbins_fd_ref = database_quote('category',$fd_ref);

$sql_statement = "

SELECT category_name,category_desc
FROM category
WHERE category_id=$dbins_fd_ref

";

@title = database_call('category','SELECT',$sql_statement);

foreach $row(@title) {($page_title,$page_desc) = @$row;}

} elsif ($fd_pg eq "ste_prod") {

$dbins_fd_ref = database_quote('product',$fd_ref);

$sql_statement = "

SELECT product_name,product_desclong,product_keywords
FROM product
WHERE product_id=$dbins_fd_ref

";

@title = database_call('product','SELECT',$sql_statement);

foreach $row(@title) {($page_title,$page_desc,$page_keywords) = @$row;}

$fd_cat = $q->param('cat');

if ($fd_cat ne "") {

$dbins_fd_cat = database_quote('product',$fd_cat);

$sql_statement = "

SELECT category_name,category_desc
FROM category
WHERE category_id=$dbins_fd_cat

";

@title = database_call('category','SELECT',$sql_statement);

foreach $row(@title) {($cat_title,$cat_desc) = @$row;}

if ($cat_title ne "") {

$page_title = "$cat_title\: $page_title";

} ######### End of if statement.

if ($cat_desc ne "") {

$page_desc = "$cat_desc\: $page_desc";

} ######### End of if statement.

} ######### End of if statement.

} else {

if ($page_name ne "") {

$page_title = "$page_name";

} ######### End of if statement.

} ######### End of if statement.

if ($page_title ne "") {

$html_title_bar_text = "$html_site_name\: $page_title";
$html_title_bar_text =~ s/<[^>]*.//gs;

} ######### End of if statement.

if ($page_desc ne "") {

$html_desc_text = "$page_desc";
$html_desc_text =~ s/<[^>]*.//gs;

} ######### End of if statement.

if ($page_keywords ne "") {

$html_keywords_text = "$page_keywords";
$html_keywords_text =~ s/<[^>]*.//gs;

} ######### End of if statement.


#########
######### End mod for meta tags.
#########


&display_print('ste_layout');

} ######### End of if statement.

&initialize_sub_remove('ste_exec');

} ######### End of if statement.

#########
######### This is a routine where the initialize_sub_remove
######### routine call is moved to within an if statement.  If the 
######### page calls a subroutine (process routine) we want to run
######### that then come back to ste_exec once processing is
######### completed.  If we're just calling an element, we'll do 
######### that from within this routine.  See code directly above.
#########

} ######### End of subroutine.

Hope this helps.

Lisa

Offline

 

#27 11-12-2003 09:54:29

lake
Member
Registered: 09-12-2003
Posts: 54

Re: Product/category/page Name In Page Title

thanks for all your help. I pasted the code as you suggested and that didn't work either.

I guess I'll just keep doing what I've been doing-- create static html pages for each product that I have. It's a pain, but I can't get the dynamic way to work for the life of me.

:-(

lake

Offline

 

#28 11-12-2003 10:25:14

Lisaweb
Member
From: CA
Registered: 04-21-2003
Posts: 417

Re: Product/category/page Name In Page Title

Hmmm.  Very odd.  The only thing I can think of is that one of your ccp files is corrupted; or you still have an old ccp file that didn't get upgraded during an install.

Lisa

Offline

 

#29 11-21-2003 12:19:59

karleil
Member
From: Pennsylvania
Registered: 09-19-2003
Posts: 39
Website

Re: Product/category/page Name In Page Title

I hate to sound stupid, but I'm assuming that if I apply this mod I do NOT need to create static HTML product pages?

Offline

 

#30 11-21-2003 13:35:42

sgreiner
Member
Registered: 07-26-2003
Posts: 78

Re: Product/category/page Name In Page Title

No static html pages needed.


Scott

Offline

 

#31 12-04-2003 23:22:07

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Product/category/page Name In Page Title

I have a slight change I'd like to implement to this as some of the search engine info I've been reading is placing more and more emphasis on the title tag.

I'd like the product name or categories to appear first, then the word "at" then the site name you've entered in admin.

Currently it reads:

ItsAlreadySigned4U.com Sports Memorabilia: Mickey Mantle Autographed Baseball

I'd like it to read:

Mickey Mantle Autographed Baseball at ItsAlreadySigned4U.com Sports Memorabilia

or for a category

Baseballs at ItsAlreadySigned4U.com

No colon but with the word "at".

I believe this will help the search engine situation with the important product words first.


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#32 12-05-2003 07:28:03

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Product/category/page Name In Page Title

I got it.

I took this:

$html_title_bar_text = "$html_site_name\: $page_title";

and made it this:

$html_title_bar_text = "$page_title\ At $html_site_name";

Works perfectly to read:

About Us At ItsAlreadySigned4U.com or

Mickey Mantle Baseball At ItsAlreadySigned4U.com


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#33 03-23-2004 08:07:08

ogradka
Member
Registered: 03-19-2004
Posts: 20

Re: Product/category/page Name In Page Title

Brilliant mod, the business!!!

I just added a couple of extra bits so that the item price would also show up in the title bar,



$sql_statement = "

SELECT product_name,product_desclong,product_keywords
FROM product
WHERE product_id=$dbins_fd_ref

";

@title = database_call('product','SELECT',$sql_statement);

foreach $row(@title) {($page_title,$page_desc,$page_keywords) = @$row;}



$sql_statement = "

SELECT product_name,product_regprice,product_desclong,product_keywords
FROM product
WHERE product_id=$dbins_fd_ref

";

@title = database_call('product','SELECT',$sql_statement);

foreach $row(@title) {($page_title,$page_price,$page_desc,$page_keywords) = @$row;}


then towards the bottom


if ($page_title ne "") {

$html_title_bar_text = "$html_site_name\: $page_title ";
$html_title_bar_text =~ s/<[^>]*.//gs;



if ($page_title ne "") {

$html_title_bar_text = "$html_site_name\: $page_title \£$page_price";
$html_title_bar_text =~ s/<[^>]*.//gs;

maybe their is a neater way to implement this mod,

But in a competative business this will let people know we are the cheapest from the outset.

Offline

 

#34 03-24-2004 17:36:48

scoutch
Banned
Registered: 07-03-2003
Posts: 3167

Re: Product/category/page Name In Page Title

Would you mind specify the files you edited these entries as well ? There are no results for your mentionned SQL statement anywhere. EXCELLENT ! feature I really must admit. Even, I, didn't thought of that one. There's absolutely "no other cart system on the net" that has this feature. If so, proove me wrong !


______________________________________________

THIS USER HAS BEEN BANNED FROM THIS FORUM.

If this post contains any language related to
code samples, advice, etc., please read this
entire thread before making a decision to use
this post as a basis for any change to your
software installation.
______________________________________________

Offline

 

#35 03-24-2004 23:11:51

48hourprint.com
Member
Registered: 12-06-2003
Posts: 19

Re: Product/category/page Name In Page Title

Wow.. has this mod REALLY been here since October!?! And i missed it! OMG...

Has anyone seen any improvements from a SE picking up the URL??? Does the product URL stand a chance of getting indexed?? i.e.


Offline

 

#36 03-25-2004 05:06:48

ogradka
Member
Registered: 03-19-2004
Posts: 20

Re: Product/category/page Name In Page Title

Scoutch, I made the additions in the st_exec.pl file as Nick showed us. it really is little more than adding a couple of other variables in the mix.

The only real problem is with the £ symbol, which displays on every heading, I need to fiddle about with that a bit

K

Offline

 

#37 03-28-2004 05:22:03

Ed_H
Member
From: Smashachusetts
Registered: 09-12-2003
Posts: 397
Website

Re: Product/category/page Name In Page Title

Great mod!  I'm getting ready to shift from static pages and couldn't ask for a better tool (will be really useful with ATS seo mod).  Made a few changes to suit my seo preferences that differ from the the above version as follows:

Merges Product Name and Product Short Description for the Page Title for product pages, truncated at 60 characters with the intention of beginning all short descriptions with " - ".

Does not merge category/product on product page descriptions, uses only the Product Long Description, still truncated at 150 characters.

Admittedly, I'm pretty ham-handed when it comes to perl so if anyone spots a mistake let me know.  Tests out okay though....

$page_title = "";

if ($fd_pg eq "ste_cat") {

$dbins_fd_ref = database_quote('category',$fd_ref);

$sql_statement = "

SELECT category_name,category_desc
FROM category
WHERE category_id=$dbins_fd_ref

";

@title = database_call('category','SELECT',$sql_statement);

foreach $row(@title) {($page_title,$page_desc) = @$row;}

} elsif ($fd_pg eq "ste_prod") {

$dbins_fd_ref = database_quote('product',$fd_ref);

$sql_statement = "

SELECT product_name,product_descshort,product_desclong,product_keywords
FROM product
WHERE product_id=$dbins_fd_ref

";

@title = database_call('product','SELECT',$sql_statement);

foreach $row(@title) {($page_title,$page_title_ext,$page_desc,$page_keywords) = @$row;}

$fd_cat = $q->param('cat');

if ($fd_cat ne "") {

$dbins_fd_cat = database_quote('product',$fd_cat);

$sql_statement = "

SELECT category_name,category_desc
FROM category
WHERE category_id=$dbins_fd_cat

";

@title = database_call('category','SELECT',$sql_statement);

foreach $row(@title) {($cat_title,$cat_desc) = @$row;}

if ($cat_title ne "") {

$page_title = "$page_title";

} ######### End of if statement.

if (($fd_pg eq "ste_cat")&&($cat_desc ne "")) {

$page_desc = "$cat_desc";

} ######### End of if statement.

} ######### End of if statement.

} else {

if ($page_name ne "") {

$page_title = "$page_name";

} ######### End of if statement.

} ######### End of if statement.

if ($page_title ne "") {

$html_title_bar_text = "$page_title$page_title_ext";
$html_title_bar_text =~ s/<[^>]*.//gs;
$html_title_bar_text = vars_truncate($html_title_bar_text,'60');

} ######### End of if statement.

if ($page_desc ne "") {

$html_desc_text = "$page_desc";
$html_desc_text =~ s/<[^>]*.//gs;
$html_desc_text = vars_truncate($html_desc_text,'150');

} ######### End of if statement.

if ($page_keywords ne "") {

$html_keywords_text = "$page_keywords";
$html_keywords_text =~ s/<[^>]*.//gs;

} ######### End of if statement.

Offline

 

#38 03-28-2004 10:34:01

scoutch
Banned
Registered: 07-03-2003
Posts: 3167

Re: Product/category/page Name In Page Title

Ed_H,

Could you specify, from your MOD, the "precise" files we have to add these commands please ? !

Thanks.

Sounds like a good MOD too.


______________________________________________

THIS USER HAS BEEN BANNED FROM THIS FORUM.

If this post contains any language related to
code samples, advice, etc., please read this
entire thread before making a decision to use
this post as a basis for any change to your
software installation.
______________________________________________

Offline

 

#39 03-28-2004 14:07:47

Ed_H
Member
From: Smashachusetts
Registered: 09-12-2003
Posts: 397
Website

Re: Product/category/page Name In Page Title

In  right before  - same as Nick specified in the first post in this thread.  Mine is not separate mod - I just tweaked it to suit my preferences and posted it in case someone else might find it useful....

Offline

 

#40 03-28-2004 14:10:12

scoutch
Banned
Registered: 07-03-2003
Posts: 3167

Re: Product/category/page Name In Page Title

Excellent then. Is your modifications approved and ready to use though ?

It sounds very interesting. smile


______________________________________________

THIS USER HAS BEEN BANNED FROM THIS FORUM.

If this post contains any language related to
code samples, advice, etc., please read this
entire thread before making a decision to use
this post as a basis for any change to your
software installation.
______________________________________________

Offline

 

#41 03-28-2004 15:36:33

Ed_H
Member
From: Smashachusetts
Registered: 09-12-2003
Posts: 397
Website

Re: Product/category/page Name In Page Title

Well, I don't know if there is an approval authority, but insofar as it does what I want it to do and doesn't break anything, yes it's ready to use.

Offline

 

#42 03-28-2004 15:43:09

scoutch
Banned
Registered: 07-03-2003
Posts: 3167

Re: Product/category/page Name In Page Title

That's not what I meant. The way I asked it was : Is it really ready for everybody ? !

It is ? I can't wait to try this then. smile


______________________________________________

THIS USER HAS BEEN BANNED FROM THIS FORUM.

If this post contains any language related to
code samples, advice, etc., please read this
entire thread before making a decision to use
this post as a basis for any change to your
software installation.
______________________________________________

Offline

 

#43 03-28-2004 19:10:23

Ed_H
Member
From: Smashachusetts
Registered: 09-12-2003
Posts: 397
Website

Re: Product/category/page Name In Page Title

That's not what I meant. The way I asked it was : Is it really ready for everybody ? !

I've already stated that it's just a tweak to the mod posted in this thread, it works, and doesn't break anything, and I just posted it in case it might save someone else a little time & effort.  Is there a board of review or something that I've missed?

As with using any code posted in the forum,  of the file being edited and give it a whirl.

Offline

 

#44 03-28-2004 19:13:38

scoutch
Banned
Registered: 07-03-2003
Posts: 3167

Re: Product/category/page Name In Page Title

Nope, you are in the right section. smile


______________________________________________

THIS USER HAS BEEN BANNED FROM THIS FORUM.

If this post contains any language related to
code samples, advice, etc., please read this
entire thread before making a decision to use
this post as a basis for any change to your
software installation.
______________________________________________

Offline

 

#45 03-10-2005 02:22:41

ramayes
Member
From: Houston, Texas
Registered: 10-04-2003
Posts: 73
Website

Re: Product/category/page Name In Page Title

I have added the seo mod listed above. The last one I tried was by ED_H on 3/28/2004. However, after having tried all the mods posted, I still get something like:



in the browser address bar. Am I mistaken that I should get something different -- ie: no ? in the address bar?

Incidently, the meta tags on the resulting pages are all just fine. The tags part seem to be working great.


Anne Mayes

Offline

 

#46 03-10-2005 09:29:15

Ed_H
Member
From: Smashachusetts
Registered: 09-12-2003
Posts: 397
Website

Re: Product/category/page Name In Page Title

The modifications in this thread affect only page titles, meta descriptions, & keywords.  The  provided by Mark rewrites the URLs to a search engine friendly format and is well worth the investment in my opinion.

Offline

 

#47 03-26-2005 20:35:24

BlueAegis
Member
Registered: 03-26-2005
Posts: 6

Re: Product/category/page Name In Page Title

Referencing the really sweet code posted by Webmaster on 10/30/2004, I have tinkered around and we can now have keywords populate the meta tag for category pages. In the past, keywords only populated the meta tag on product description pages.

Okay, here's what we do.

Step 1:
From inside the Site Administrator Control Panel, select "Database Utilities|Manage User Defined Table Columns". In table-name "Category", click Update. Create a new column in the table with the following values -
Column Name: category_metakw
Description: Meta Tag Keywords
Number of Characters: 150
Field Required in Admin: Yes
Admin Display Type: Regular Textarea

Then click the Submit button. Now, when you create a category you will be required to enter keywords. Make sure they are comma delimited.

Step 2:
In ste_exec.pl, make the following changes to Webmaster's code -


Code:

 $sql_statement = "SELECT category_name,category_desc FROM category WHERE category_id=$dbins_fd_ref";
 @title = database_call('category','SELECT',$sql_statement);
 foreach $row(@title){($page_title,$page_desc) = @$row;}


Code:

 $sql_statement = "SELECT category_name,category_desc,category_metakw FROM category WHERE category_id=$dbins_fd_ref";
 @title = database_call('category','SELECT',$sql_statement);
 foreach $row(@title){($page_title,$page_desc,$page_kw) = @$row;}


Code:

if($page_keywords ne ""){
 $html_keywords_text = "$page_keywords";
 $html_keywords_text =~ s/<[^>]*.//gs;
 $html_keywords_text = vars_truncate($html_keywords_text,'150');
}


Code:

if($page_keywords ne ""){
 $html_keywords_text = "$page_keywords";
 $html_keywords_text =~ s/<[^>]*.//gs;
 $html_keywords_text = vars_truncate($html_keywords_text,'150');
}else{
 if($page_kw ne ""){
  $html_keywords_text = "$page_kw";
  $html_keywords_text =~ s/<[^>]*.//gs;
  $html_keywords_text = vars_truncate($html_keywords_text,'150');
 }
}

Have fun!

Roy

Offline

 

#48 08-28-2005 08:44:42

andyM
Member
Registered: 08-28-2005
Posts: 161

Re: Product/category/page Name In Page Title

Can someone tell what i can edit if i have the ATS seo mod installed? As it stands, the meta description is the entire decsription which is just plain mad! Can i truncate it using the hack seen in this thread with the ATS seo mod installed?

Offline

 

#49 08-28-2005 10:58:08

Big Dave
Member
Registered: 10-24-2003
Posts: 742

Re: Product/category/page Name In Page Title

I believe that you can accomplish this with Marks (ATS) SEO PRO mod. It is an update to his SEO mod that allows you to specify URL, keywords, meta-tags, description, etc. It is also product specific, so you can change each product individually.

Offline

 

#50 08-28-2005 11:54:58

andyM
Member
Registered: 08-28-2005
Posts: 161

Re: Product/category/page Name In Page Title

Thanks, yes i saw that. Just wondered if i could save some money. I'm fine with the normal seo urls, can alter the per-product meta keywords - It's just the meta description for products/categories and title for splash page/ online store homepage that i am in need of. Do you know if i can apply that truncate hack? The search engines might think i'm spamming with a 400 word meta description!

Offline

 

Board footer