Author |
Topic |
|
aztech24
Starting Member
6 Posts |
Posted - September 10 2009 : 11:34:26
|
Hi how can i change the footer in shopexd.asp page ? I want a seperate footer for this page but as this page has a generic footer "shoppage_trailer.htm" if some change in this one then it will effect the whole site. Thats why i want to have a seperate footer for this page.
Thanks in Advance |
|
creativechaos
VP-CART New User
Australia
64 Posts |
Posted - September 17 2009 : 00:59:03
|
Hi,
This customization request comes up a bit so I thought I'd write up a reply in a "tutorial" type format.
By default, VPASP uses the shoppage_header.htm file to control the layout of the top and left side of all pages on your site. Similarly, the shoppage_trailer.htm file is used to style the bottom and right hand side of all pages.
In some situations, you may want a different header or footer on certain pages within your site.
Setting this up is actually quite simple and for this example we will show you how you can add a custom header and footer for all shopexd.asp pages.
Firstly, create a copy of the shoppage_header.htm file and call this shoppage_header_shopexd.htm. Next, create a copy of the shoppage_trailer.htm file and call this shoppage_trailer_shopexd.htm.
You can then add whatever custom code you want into those two new header and trailer files.
Next, you will need to make a small change to the shopheaders.asp file in VPASP.
To set up different headers, locate the "Sub ShopPageHeader" subroutine, and find the code that reads:
%>
<!-- #include file="shoppage_header.htm" -->
<%
Alter this to read:
'USE A DIFFERENT HEADER INCLUDE FOR EACH PAGE
dim currenturl, compareurl
currenturl = request.ServerVariables("URL")
compareurl = mid(currenturl, InStrRev(currenturl, "/")+1)
select case compareurl
case "shopexd.asp"
%>
<!-- #include file="shoppage_header_shopexd.htm" -->
<%
case else
%>
<!-- #include file="shoppage_header.htm" -->
<%
end select
You can do the same with the footers by making a similar adjustment to the "Sub ShopPageTrailer" subroutine.
Locate the code:
%>
<!-- #include file="shoppage_trailer.htm" -->
<%
And alter this to read:
'USE A DIFFERENT FOOTER INCLUDE FOR EACH PAGE
dim currenturl, compareurl
currenturl = request.ServerVariables("URL")
compareurl = mid(currenturl, InStrRev(currenturl, "/")+1)
select case compareurl
case "shopexd.asp"
%>
<!-- #include file="shoppage_trailer_shopexd.htm" -->
<%
case else
%>
<!-- #include file="shoppage_trailer.htm" -->
<%
end select
Now save the shopheaders.asp file and upload to your server along with your custom shoppage_header_shopexd.htm and shoppage_trailer_shopexd.htm files.
Go to your storefront and view a shopexd.asp page - you should see your custom header and trailer are now in place.
You can add multiple case statements to each of the sub routines if you want to have a custom header or trailer for any of the pages within VPASP. eg.
case "shopdisplayproducts.asp"
%>
<!-- #include file="shoppage_trailer_shopdisplayproducts.htm" -->
<%
Hope this helps!
By the way, I have been thinking about putting together a collection of tutorials like this so let me know if there are any other topics that anyone would be interested in and I will see what I can do!
Cheers,
Michael Dunkley Creative Chaos http://www.creativechaos.com.au |
|
|
InkMagic
VP-CART New User
123 Posts |
Posted - February 12 2010 : 12:08:39
|
I found your 'tutorial' very interesting. From the date of the post I presume this is for Version 6.5 or earlier. Will it work on Version 7?
I need to use a different header for the shop checkout because my default header calls a talking character from outside my site so you get a security warning during the checkout. Would the coding be much different for version 7?
Any help would be appreciated!!
Thank you!!
Dale
|
|
|
creativechaos
VP-CART New User
Australia
64 Posts |
Posted - February 12 2010 : 18:31:32
|
Hi Dale,
The concept is still similar for version 7.0 - but the coding is different obviously with the introduction of templates being housed within their own folders.
For version 7.0 - you still edit shopheaders.asp, and the shoppageheader or shoppagetrailer sub routines as above, but instead of the include code, VPASP 7.0 uses a function called dyninclude to load the shoppage_header.htm file.
Essentially for version 7.0 the line you need to change is:
dyninclude xMySite2 & "/templates/" & getconfig("xtemplate") & "/shoppage_header.htm"
Change this to:
'USE A DIFFERENT HEADER INCLUDE FOR EACH PAGE
dim currenturl, compareurl
currenturl = request.ServerVariables("URL")
compareurl = mid(currenturl, InStrRev(currenturl, "/")+1)
select case compareurl
case "shopexd.asp"
dyninclude xMySite2 & "/templates/" & getconfig("xtemplate") & "/shoppage_header_shopexd.htm"
case else
dyninclude xMySite2 & "/templates/" & getconfig("xtemplate") & "/shoppage_header.htm"
end select
This example will display the contents of shoppage_header_shopexd.htm on the shopexd.asp page. You need to create the shoppage_header_shopexd.htm file and place it into the template folder you are currently using.
For changing your checkout page, change the case statement to the name of your checkout page (ie case "shopcheckout.asp"
For changing the footer files, the concept is the same but the changes need to be made in the shoppagetrailer sub routine.
Hope this helps.
Feel free to contact us directly for customization assistance.
Cheers,
Michael Dunkley Creative Chaos http://www.creativechaos.com.au
|
Edited by - creativechaos on April 20 2010 07:00:04 |
|
|
lesharrison
Starting Member
18 Posts |
Posted - May 17 2010 : 18:04:51
|
This is a great tutorial.. and it is much appreciated!
Now.. what I need to to with 6.50+ is the same thing with content only pages. IE: I need to format pages that will be only for text (content management) differently than those for products. This site is actually all content management with a couple of registration products for classes and events.
When I applied your changes and setup the shoppage_header_shopexd and trailer file, it works fine but for pages where I use the contentid# in the url, shopexd.asp says it wants a catalog id.
Any clues will be appreciated.
|
Edited by - lesharrison on May 17 2010 18:08:51 |
|
|
creativechaos
VP-CART New User
Australia
64 Posts |
Posted - May 17 2010 : 18:57:36
|
Hi Les,
When you are using content pages - you would load these through shopcontent.asp
You need to add a new case statement like:
select case compareurl
case "shopexd.asp"
%>
<!-- #include file="shoppage_header_shopexd.htm" -->
<%
case "shopcontent.asp"
%>
<!-- #include file="shoppage_header_shopcontent.htm" -->
<%
case else
%>
<!-- #include file="shoppage_header.htm" -->
<%
end select
You then need to set your links to these content pages with a reference like shopcontent.asp?type=nameofyourcontentpage
Obviously you would replace nameofyourcontentpage with the name you need to link to.
Hope this helps.
If you still have trouble, put up a link of your site and where you're having trouble and I'll see what I can advise.
Cheers
Michael Dunkley Creative Chaos http://www.creativechaos.com.au |
|
|
lesharrison
Starting Member
18 Posts |
Posted - May 17 2010 : 20:46:21
|
creativechaos! Many thanks, this worked perfectly. After years of using this version, I now can make pages display like I need them. Write a pdf book of your tutes and I will buy the first copy!
Thanks,
Les |
|
|
rumpus
Starting Member
13 Posts |
Posted - May 21 2010 : 04:25:27
|
Michael, we use 6.5 and need to have the option to set a site template to match the manufactures branding. So we need to have a template for each category, not just for the product display but the entire site template. Do you think you could code a mod like this up?
Thanks, Andrew |
|
|
creativechaos
VP-CART New User
Australia
64 Posts |
|
|
Topic |
|