Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 ASP (Windows server) versions
 Dynamic title and meta description tags
Author « Topic »  

Marshall
Ecommerce Template Guru

USA
1874 Posts

Posted - 03/16/2020 :  11:06:00  
Is there an advanced version like there is with PHP? (https://www.ecommercetemplates.com/seo/dynamic-title-meta-php.asp)

Marshall
CENLYT Productions - ms designs
Affordable Web Design
Custom Ecommerce Designs
Responsive Websites
Cenlyt.com

1818charlie
ECT Moderator

United Kingdom
1179 Posts

Posted - 03/16/2020 :  17:51:23  
Hi Marshall

Is this what you are looking for?

https://www.ecommercetemplates.com/seo/dynamic-title-meta-asp.asp

Steve
Bolton, Lancashire, UK

Remember - Any edits to the ectcart.css file will be overwritten by updater's. ALL edits to ectcart.css rules should be placed in your style.css folder.

Marshall
Ecommerce Template Guru

USA
1874 Posts

Posted - 03/16/2020 :  19:14:09  
No Steve, that is the simple one. The advanced one for PHP has a lot more variables and I was not sure if Vince had written one for ASP. Would save me the time doing so.

Marshall
CENLYT Productions - ms designs
Affordable Web Design
Custom Ecommerce Designs
Responsive Websites
Cenlyt.com

Vince
Administrator

42460 Posts

Posted - 03/17/2020 :  05:21:57  
Hi Marshall
Just copy and paste the PHP code here and I'll let you know the ASP version.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

Marshall
Ecommerce Template Guru

USA
1874 Posts

Posted - 03/17/2020 :  07:20:14  
It is all here https://www.ecommercetemplates.com/seo/dynamic-title-meta-php.asp, bit okay.

Advanced categories.php settings

Instead of using the above, copy and paste the following lines into vsadmin/includes.php (changing the text for your own)

$GLOBALS['sitenamelong']='The name of your site goes here (around 50-60 characters and unique)';
$GLOBALS['rootcategorytitle']='The page title to appear on the main categories.php page (around 50-60 characters)';
$GLOBALS['rootcategorydescription']='The page meta description to appear on the main categories.php page (around 160 characters max)';

Replace the title and meta description tags on categories.php with the following

<title><?php
if(!empty($pagetitle)) {print $pagetitle;}
else if(!empty($sectionname)) {print $sectionname . ' | ' . $sitenamelong;}
else {print $rootcategorytitle;} ?></title>
<meta property="og:title" content="<?php
if(!empty($pagetitle)) {print $pagetitle;}
else if(!empty($sectionname)) {print $sectionname . ' | ' . $sitenamelong;}
else {print $rootcategorytitle;} ?>">

<meta name="Description" content="<?php if(!empty($sectiondescription)) {print str_replace('"','"',$sectiondescription);} else {print $rootcategorydescription;} ?>">

Make sure you test the results by viewing source on your category and sub-category pages.


Advanced products.php settings

Instead of using the above, copy and paste the following lines into vsadmin/includes.php (changing the text for your own)

$GLOBALS['sitename']='The name of your site goes here (around 50-60 characters)';
$GLOBALS['allpagestitle']='The page title to appear on the main products.php page (around 50-60 characters)';
$GLOBALS['allpagesdescription']='The page meta description to appear on the main products.php page (around 160 characters max)';

Replace the title and meta description tags on products.php with the following

<?php $pno = (isset($_GET['pg']) && is_numeric($_GET['pg'])) ? (int)$_GET['pg'] : 1; $pagenumber = ' page ' . $pno; ?>
<title><?php
if(!empty($pagetitle) && $pno == 1) {print $pagetitle;}
else if(!empty($pagetitle) && $pno != 1){print $pagetitle . $pagenumber;}
else if(!empty($sectionname) && $pno == 1) {print $sectionname . ' | ' . $sitename;}
else if(!empty($sectionname) && $pno != 1) {print $sectionname . ' | ' . $sitename . $pagenumber;}
else if($pno == 1) {print $allpagestitle;}
else {print $allpagestitle . $pagenumber;} ?></title>

<meta name="Description" content="<?php
if(!empty($sectiondescription) && $pno < 2) {print $sectiondescription;}
else if(!empty($sectiondescription) && $pno > 1) {print $sectiondescription . ' ' . $pagenumber;}
else if($pno < 2) {print $allpagesdescription;}
else {print $allpagesdescription . ' ' . $pagenumber;} ?>">

Make sure you test the results by viewing source on your product pages.

Marshall
CENLYT Productions - ms designs
Affordable Web Design
Custom Ecommerce Designs
Responsive Websites
Cenlyt.com

Vince
Administrator

42460 Posts

Posted - 03/18/2020 :  03:56:45  
Hi Marshall
How's this then...



Advanced categories.asp settings

Instead of using the above, copy and paste the following lines into vsadmin/includes.asp (changing the text for your own)

sitenamelong="The name of your site goes here (around 50-60 characters and unique)"
rootcategorytitle="The page title to appear on the main categories.asp page (around 50-60 characters)"
rootcategorydescription="The page meta description to appear on the main categories.asp page (around 160 characters max)"

Replace the title and meta description tags on categories.asp with the following

<title><%
if pagetitle<>"" then
print pagetitle
elseif sectionname<>"" then
print sectionname & " | " & sitenamelong
else
print rootcategorytitle
end if %></title>
<meta property="og:title" content="<%
if pagetitle<>"" then
print pagetitle
elseif sectionname<>"" then
print sectionname & " | " & sitenamelong
else
print rootcategorytitle
end if %>" />

<meta name="description" content="<% if sectiondescription<>"" then print replace(sectiondescription,"""","""") else print rootcategorydescription %>" />

Make sure you test the results by viewing source on your category and sub-category pages.

Advanced products.asp settings

Instead of using the above, copy and paste the following lines into vsadmin/includes.asp (changing the text for your own)

sitename="The name of your site goes here (around 50-60 characters)"
allpagestitle="The page title to appear on the main products.asp page (around 50-60 characters)"
allpagesdescription="The page meta description to appear on the main products.asp page (around 160 characters max)"

Replace the title and meta description tags on products.asp with the following

<%
pno=1
if request.querystring("pg")<>"" AND isnumeric(request.querystring("pg")) then pno=cint(request.querystring("pg"))
pagenumber=" page " & pno %>
<title><%
if pagetitle<>"" AND pno=1 then
print pagetitle
elseif pagetitle<>"" AND pno<>1 then
print pagetitle & pagenumber
elseif sectionname<>"" AND pno=1 then
print sectionname & " | " & sitename
elseif sectionname<>"" AND pno<>1 then
print sectionname & " | " & sitename & pagenumber
elseif pno=1 then
print allpagestitle
else
print allpagestitle & pagenumber
end if %></title>

<meta name="description" content="<%
if sectiondescription<>"" AND pno < 2 then
print sectiondescription
elseif sectiondescription<>"" AND pno > 1 then
print sectiondescription & " " & pagenumber
elseif pno < 2 then
print allpagesdescription
else
print allpagesdescription & " " & pagenumber
end if %>" />

Make sure you test the results by viewing source on your product pages.


Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

Marshall
Ecommerce Template Guru

USA
1874 Posts

Posted - 03/18/2020 :  04:54:42  
Thanks Vince.

Marshall
CENLYT Productions - ms designs
Affordable Web Design
Custom Ecommerce Designs
Responsive Websites
Cenlyt.com
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.02 seconds. Snitz Forums 2000