Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 Give pages a unique title
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Superal
VP-CART Expert

Canada
542 Posts

Posted - September 24 2002 :  16:38:10  Show Profile  Reply with Quote
Ethan came up with a very nice way of doing this so kudos to him. I just fixed it.
==================================================
This is what I added to shopdb:

'********** My Custom Variables
Dim SCRIPT_NAME
Dim PageTitle

I changed the top of my shoppage_header to be this:

<%
SCRIPT_NAME = Request.ServerVariables("SCRIPT_NAME")

if PageTitle <> "" Then
Select Case SCRIPT_NAME
Case "/shopdisplayproducts.asp"
PageTitle = Request.QueryString("cat") & " @YourStore.com"
Case "/shopdisplaycategories.asp"
PageTitle = "Product Categories - YourStore.com"
Case "/shopaddtocart.asp"
PageTitle = "Add Product to Cart - YourStore.com"
Case "/shopcustomer.asp"
PageTitle = "Account Creation - YourStore.com"
Case "/shopcreateorder.asp"
PageTitle = "Checkout Step 1 of 2 - YourStore.com"
Case "/shopthanks.asp"
PageTitle = "Thanks for Your Order @ YourStore.com"
Case Else
PageTitle = "The Store For People by People - YourStore.com"
End Select
End If
%>
<title><%= PageTitle %></title>

Then in order to make my shopexd show the product name as the title did this (lines 57-63 in v4.5):

If rs.eof then
Serror = SError & LangReadFail & " " & catalogid
HandleError
end if
PageTitle=rs.fields("cname") & " - YourStore.com"
end sub


vitatroy
Starting Member

1 Posts

Posted - March 29 2003 :  23:38:14  Show Profile  Reply with Quote
Exactly where do you paste this in at? You you overwrite the present code, or do you add to it? Here are my shopexd.asp lines 53 - 66. I cannot seem to get it to work. Limited asp knowlwdge. Any help?

'
Sub OpenRecordSet (RS)
If catalogid<>"" then
Sql="select * from products where catalogid=" & catalogid
else
sql="select * from products where ccode='" & ccode & "'"
end if
Set rs=dbc.execute(sql)
If rs.eof then
Serror = SError & LangReadFail & " " & catalogid
HandleError
end if
end sub
'


Where do I paste the following code at?

did this (lines 57-63 in v4.5):

If rs.eof then
Serror = SError & LangReadFail & " " & catalogid
HandleError
end if
PageTitle=rs.fields("cname") & " - YourStore.com"
end sub



Go to Top of Page

Habitue
VP-CART New User

USA
90 Posts

Posted - August 22 2003 :  03:38:08  Show Profile  Reply with Quote
I'm curious; would this code work for ver.5.00?

~Habitue~

Go to Top of Page

Habitue
VP-CART New User

USA
90 Posts

Posted - August 22 2003 :  04:48:52  Show Profile  Reply with Quote
The code meant to make shopexd show the product name in the title works pretty well; however, the other pages always result in Case Else

I guess it'll take some more diggin'

Peace,

~Habitue~

Go to Top of Page

lynch
VP-CART New User

USA
74 Posts

Posted - August 25 2003 :  16:28:57  Show Profile  Reply with Quote
quote:

I'm curious; would this code work for ver.5.00?



I'm curious too, since I'm putting together a store with version 5 too...

-- lynch

Go to Top of Page

Justin
VP-CART New User

87 Posts

Posted - April 21 2004 :  05:33:45  Show Profile  Visit Justin's Homepage  Reply with Quote
Thanks for the code, guys.

I noticed it was made for people who don't call shoppageheader from shopexd. For those who use the shoppageheader on their extended description pages, here's a sample of what you might want to try doing to the code:


<%
SCRIPT_NAME = Request.ServerVariables("SCRIPT_NAME")

' ------------------------------------- debugging and testing
'response.write(right(SCRIPT_NAME,12))
'response.write("<br>" & PageTitle)

' ----------------------------- deleted and logic moved to a Case
' ----------------------------- statement below.
'if PageTitle <> "" Then


Select Case right(SCRIPT_NAME,12) ' -------------- get 12 right most
' ------------------------------------------------ values only.
Case "products.asp"
if Request.QueryString("cat") <> "" then
PageTitle = Request.QueryString("cat") & " - yourshop.com"
else
PageTitle = "Products - yourshop.com" ' ------ eg for searches
end if
Case "tegories.asp"
PageTitle = Request.QueryString("cat") & " - yourshop.com"
Case "ddtocart.asp"
PageTitle = "Your Shopping Cart - yourshop.com"

'--------------------- changed some of the headings to suit my shop
Case "customer.asp"
PageTitle = "Checkout Step 1 of 3: Delivery Address - yourshop.com"
Case "ateorder.asp"
PageTitle = "Checkout Step 2 of 3: Order Details - yourshop.com"
Case "checkout.asp"
PageTitle = "Checkout Step 3 of 3: Payment Details - yourshop.com"
Case "opthanks.asp"
PageTitle = "Thankyou for Your Order - yourshop.com"
Case "/shopexd.asp"
PageTitle=PageTitle ' ----------------------------------------- dummy
Case Else
PageTitle = "yourshop.com"
End Select

' ----------------------------- deleted
'End If
%>
<title><% =PageTitle %></title>



You'll notice a couple of other changes I made there. You just have to make sure that you call shopdisplayheader *after* this line in shopexd:


OpenRecordSet tmpRS


You still have to insert the other line (PageTitle=rs.fields("cname") & " - YourStore.com"
) into shopexd.

You'll notice I only look at the last 12 characters of the filename. This is a hack because I don't know exactly what directory structure I'll have when my site goes live, whether everything will be in the root directory or a shopping directory or what. crude but it works.

JL

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00