Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Using multiple headers in asp
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Using multiple headers in asp

 Post Reply Post Reply
Author
zeddy View Drop Down
Newbie
Newbie
Avatar

Joined: 07 August 2007
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote zeddy Quote  Post ReplyReply Direct Link To This Post Topic: Using multiple headers in asp
    Posted: 07 August 2007 at 5:16pm

Hello there,

I am not sure if anyone can help me. I have inherited a bespoke shopping cart website which sells lots of different products. There are many different header files which have already been built. The problem is that I can only change which header the home page includes.

The website has main and sub categories which contain the products but I can't see how to specify which header file is included on these pages.

I would be extremly grateful for your help.

Many thanks in advance Cry

Steve

Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 07 August 2007 at 8:25pm
could you explain WHY your using multiple headers?

I assume you mean you have made a few header files to be included eg "header1.asp", "header2.asp" and so on.

Couldnt you have one header file and use ASP to process the header the way you want it, eg

if you have categories for each product range maybe like "Electronics | Books | Gifts"
and each had a different colour scheme you could maybe have a different CSS file for each and have at the top of every page

intCategoryID = *id*


and the id would repersent the product categories like so:

1 - electronics
2 - books
3 - gifts

so you do

<link href="style_<%=intCategoryID%>.css" rel="stylesheet" type="text/css" />


and your colour scheme changes depending on the ID in the top of the page.

aswell as CSS you could have images eg
<img src="logo_<%=intCategoryID%>.gif">
and so on
if how ever the reason is alot more complex i would suggest using one include that selects the required include. eg:

<%
   select case intCategoryID
      case 1
%><!--#include file="header1.asp"--><%
      case 2
%><!--#include file="header2.asp"--><%
      case 3
%><!--#include file="header3.asp"--><%
      case else
%><!--#include file="header-else.asp"--><%
  end select
%>



Edited by Scotty32 - 07 August 2007 at 8:25pm
S2H.co.uk - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
zeddy View Drop Down
Newbie
Newbie
Avatar

Joined: 07 August 2007
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote zeddy Quote  Post ReplyReply Direct Link To This Post Posted: 08 August 2007 at 10:50am

Hello there thanks for your response.  The reason why I have different headers is because the website sells all different products.

The idea is that for each category the site should include a different header file with relevent keywords and description for that page.

Each of the categories already have an id for example www.leisurefurniture.co.uk/category.asp?catId=709 as I mentioned the problem is that no matter what category the user selects it always includes the same header file.
 
Looking at your solution is there a way I can specify a different header file for each category id?
 
Many thanks in advance
 
Steve 
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 08 August 2007 at 6:24pm
if all you want different headers for is to change the Meta tags, i would suggest you add fields to your category table in the database for what you want to change, then when you get the category details get the meta tags and in your header have

<meta name="description" content="<%=strMetaDescription%>">

it would be far better than a different header file
S2H.co.uk - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.