ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Search Engine Optimization
  New Posts New Posts RSS Feed - H1 tag & Meta Title
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

H1 tag & Meta Title

 Post Reply Post Reply
Author
Message
whizzinpc View Drop Down
Newbie
Newbie
Avatar

Joined: 17-January-2006
Location: California
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote whizzinpc Quote  Post ReplyReply Direct Link To This Post Topic: H1 tag & Meta Title
    Posted: 28-January-2011 at 2:32pm
Is there any way to take the Meta Title of a category and have that display in an H1 tag in the body. I've tried to use the variables from the include-metatags file but nothing seems to work.
Back to Top
Brett View Drop Down
Groupie
Groupie
Avatar

Joined: 22-April-2008
Location: Phoenix, AZ
Status: Offline
Points: 89
Post Options Post Options   Thanks (0) Thanks(0)   Quote Brett Quote  Post ReplyReply Direct Link To This Post Posted: 29-January-2011 at 9:36am
First you need to edit pcBreadCrumbs.asp:

Line 17 add categories.pcCats_MetaTitle like so...

query="SELECT categories.categoryDesc, categories.idCategory, categories.idParentCategory, categories.image, categories.largeimage, categories.SDesc, categories.LDesc, categories.HideDesc, categories.pccats_BreadCrumbs, categories.pcCats_MetaTitle FROM categories WHERE (((categories.idCategory)="&pIdCategory&")" & queryHC & ") ORDER BY categories.priority, categories.categoryDesc;"
Line 38 assign a variable to that query field:

pCategoryMetaTitle=rs("pcCats_MetaTitle")


Then, go to viewcategories.asp and edit line 343 to change categoryname to categorymetatitle:

<h1><%=pCategoryMetaTitle%></h1>


Edited by Brett - 29-January-2011 at 9:46am
Back to Top
whizzinpc View Drop Down
Newbie
Newbie
Avatar

Joined: 17-January-2006
Location: California
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote whizzinpc Quote  Post ReplyReply Direct Link To This Post Posted: 01-February-2011 at 11:49am
Worked perfectly! Your the man! If its not too much to ask maybe you can help me a tiny bit more. The reason I need this is to put a header tag at the top of the page that reflect the meta tag so we can focus on a long tail keyword and not have to change the category or product name. I figured out how to show the category name if the meta tag doesn't exist. Now I need to do the same for a product. The product meta tag title I cant figure out either.
Here is what I have so far.

<% if not isNull(pCategoryMetaTitle) and pCategoryMetaTitle<>""  then %>
<h1><%=pCategoryMetaTitle%></h1>
<%else%>
<h1><%=pCategoryName%></h1>
<%end if%> 



Edited by whizzinpc - 01-February-2011 at 11:50am
Back to Top
Brett View Drop Down
Groupie
Groupie
Avatar

Joined: 22-April-2008
Location: Phoenix, AZ
Status: Offline
Points: 89
Post Options Post Options   Thanks (0) Thanks(0)   Quote Brett Quote  Post ReplyReply Direct Link To This Post Posted: 01-February-2011 at 8:35pm
Hey, I can probably help. What is a long tail keyword? I guess you want to: Display the Meta Title on the top of the category and product details (and product configuration?) pages inside a <h1> tag. What you've pasted is the code you're now using for the category pages. Is that code sufficient or do you need it to do something else?

Are you now just looking for the same functionality on the product detail pages? Let's take it one step at a time and we can definitely get all of this working.


*edit*

to clarify:

The category pages are fine now and you need the same functionality on the product detail pages?

or...

You need the same functionality on the product detail pages and you need something else done with the category pages?

Edited by Brett - 01-February-2011 at 8:38pm
Back to Top
whizzinpc View Drop Down
Newbie
Newbie
Avatar

Joined: 17-January-2006
Location: California
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote whizzinpc Quote  Post ReplyReply Direct Link To This Post Posted: 02-February-2011 at 11:14am
Basically I want to display the meta title for a category and product.
If you are on a category page then show the category meta title... if you are on a product page then show the product meta title.
If the meta title for a category doesn't exist then show the category name.
If the meta title for a product doesn't exist then show the product name.

Back to Top
Brett View Drop Down
Groupie
Groupie
Avatar

Joined: 22-April-2008
Location: Phoenix, AZ
Status: Offline
Points: 89
Post Options Post Options   Thanks (0) Thanks(0)   Quote Brett Quote  Post ReplyReply Direct Link To This Post Posted: 02-February-2011 at 3:12pm
OK cool. And I assume the stuff for the category page is fine, right? You now just need the same functionality for the product page? Gonna start looking at that now.
Back to Top
Brett View Drop Down
Groupie
Groupie
Avatar

Joined: 22-April-2008
Location: Phoenix, AZ
Status: Offline
Points: 89
Post Options Post Options   Thanks (0) Thanks(0)   Quote Brett Quote  Post ReplyReply Direct Link To This Post Posted: 02-February-2011 at 3:20pm
viewPrd.asp

Line 296 database query add pcProd_MetaTitle:

'--> gets product details from db
' PRV41 Start
query="SELECT active,iRewardPoints, description, sku, configOnly, serviceSpec, price, btobprice, listprice, listHidden, imageurl, largeImageURL, Arequired, Brequired, stock, weight, emailText, formQuantity, noshipping, custom1, content1, custom2, content2, custom3, content3, xfield1, x1req, xfield2, x2req, xfield3, x3req, noprices, IDBrand, noStock, noshippingtext,pcprod_HideBTOPrice,pcprod_QtyValidate,pcprod_MinimumQty,pcProd_multiQty, pcprod_HideDefConfig, notax, pcProd_BackOrder,pcProd_ShipNDays,pcProd_SkipDetailsPage,pcProd_HideSKU, pcPrd_MojoZoom, details, sDesc, pcProd_AvgRating, pcProd_MetaTitle FROM products WHERE idProduct=" &pidProduct & " AND configOnly=0 AND removed=0 "


Line 362 assign a variable to the database field:

'// Assign variable values
pMetaTitle=rs("pcProd_MetaTitle")


viewPrdCode.asp

Line 464 change pDescription to...

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' START: Show product name
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     
Public Sub pcs_ProductName
%>
<h1><%
if pMetaTitle<>"" then
     response.Write(pMetaTitle)
else
     response.Write(pDescription)
end if
%></h1>
<%
End Sub
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' END: Show product name
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


voila!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.078 seconds.