ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Getting Started
  New Posts New Posts RSS Feed - How to set up seperate pages with header/footer
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to set up seperate pages with header/footer

 Post Reply Post Reply Page  12>
Author
Message Reverse Sort Order
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Topic: How to set up seperate pages with header/footer
    Posted: 26-June-2008 at 4:41am
Hi, I personally wouldn't bother with a "splash" page. Customers will not always arrive on your site via the same route & I think the less there is between the customers and choosing the goods the better.
I would use a button in the header to toggle between the wide and narrow, the code behind the button toggling the value of the headerw var - which is stored & retrieved from the cookie file.  If you do want a splash page as well you can add the code to set the  cookie var in there. You could make the splash page choice using javascript.

Using ASP to work with cookies :-  http://www.w3schools.com/asp/asp_cookies.asp
Using Javascript to work with cookies :- www.w3schools.com/js/js_cookies.asp

If you use javascript ONLY use it on the splash page - it's not suitable for the ASP pages as otherwise both copies of your header will be sent to the browser as the javasc rpit executes in the browser not the server.

In header.asp you must add asp code at the beginning  to retrieve, or attempt to retrieve the cookie var headerw  (Actually the cookie vars name can be anything - it's value must end up in  vbscript var headerw).

6 files? If you haven't changed footer.asp then you only need that version of footer.asp & can delete the other two.
 
Back to Top
BlackReefDesigns View Drop Down
Newbie
Newbie


Joined: 28-May-2008
Location: San Diego, CA
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote BlackReefDesigns Quote  Post ReplyReply Direct Link To This Post Posted: 25-June-2008 at 10:58pm
Hamish - Thank you again for your help.
 
So this is what I did.
 
I created the headerwide.asp and footerwide.asp <---100% Table Width
 
I also created headerfull.asp and footerfull.asp <----800px Table Width
 
The Footer is identical in both instances.
 
The next thing I did was opened the header.asp and erased everything and put this in:
 
<% if headerw=1 then %>
<!--#include file="headerwide.asp"-->           
<% else %>
<!--#include file="headerfull.asp"-->           
<% end if %>
 
I saved the header.asp, and uploaded all 6 files.  It should be noted that all 3 footer files are identical.
 
Im pretty sure thats the way you explained it to me.  Now, this is where I get lost.  How do I set it up on the splash page so the customers can select between wide and full?  Obviously there is no .asp files to link the pages to, so how do I set it up so the customer can choose thier version?
Joe S.
BlackReef.net
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 25-June-2008 at 6:11am
Get some zzzz's Sleepy and then take a look at :-
http://www.w3schools.com/asp/default.asp - A good basic into to asp & vbscript are available there, including using cokkie based vars.
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 25-June-2008 at 6:07am
It must be mad o'clock there !! :-)

All you will need is some code to read the cookie var and the code as shown, nothing else.

home.asp and all the customer facing pages #include the header and footer files so you new versions will automatically be used and pick up the new variations of the files automatically.
 



Back to Top
BlackReefDesigns View Drop Down
Newbie
Newbie


Joined: 28-May-2008
Location: San Diego, CA
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote BlackReefDesigns Quote  Post ReplyReply Direct Link To This Post Posted: 25-June-2008 at 5:46am
Assuming Im using HeaderW and HeaderF, this will be the only code I put in the header.asp?   And what does home.asp recognize as the main page?  maybe I should get some sleep and tackle this in the morning.  my brain is mush, hehe
 
<% if headerw=1 then %>
<!--#include file="headerW.asp"-->            
<% else %>
<!--#include file="headerF.asp"-->            
<% end if %>


Edited by BlackReefDesigns - 25-June-2008 at 5:54am
Joe S.
BlackReef.net
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 25-June-2008 at 5:42am
The first version - That's in ASP/vbscript.
Effectively you are scrapping the existing header/footer and replacing them with code to select between the two alternate styles.
Don't forget you need to grab the variable headerw from the cookie - For an example of code doing that check pc/login.asp
Back to Top
BlackReefDesigns View Drop Down
Newbie
Newbie


Joined: 28-May-2008
Location: San Diego, CA
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote BlackReefDesigns Quote  Post ReplyReply Direct Link To This Post Posted: 25-June-2008 at 5:36am
Ok
 
Thanks for being patient with me.  So.....I have my Header/Footer files for both my Widescreen and Fullscreen page (4 files)   I think I am overthinking this or something because I am confused as heck right now, hehe.   So I add the 4 new files to the PC folder and keep the old Header/Footer.asp in the folder?  And they use the old header/footers for code?
 
Basically I need to know how do I modify the older Header/Footer.asp after I put the 4 new files in.   Do I add this:
 
<% if headerw=1 then %>
<!--#include file="headerW.asp"-->            
<% else %>
<!--#include file="headerF.asp"-->            
<% end if %>
 
or
 
If "fullscreen mode" then
        "include fullscreen header"
else
    "include widescreen header"
endif
 
and where do I add this to the header/footer.asp?

Thanks


Edited by BlackReefDesigns - 25-June-2008 at 5:36am
Joe S.
BlackReef.net
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 25-June-2008 at 5:26am
Yes, 
   Create the four versions.
Then header.asp and footer.asp just become bits of code to select which version of each file is used  based on the variable from  the cookie, in this case the var is called headerw :

<% if headerw=1 then %>
<!--#include file="headerW.asp"-->            
<% else %>
<!--#include file="headerF.asp"-->            
<% end if %>

The downside to this approach is there will be a small performance hit as the includes are done at the server regardless, but only the required one will be sent to the browser.
An alternative approach would be to use that same if structure around the parts of header & footer that you wish to have different versions of, but to start I would go the route of separate header & footers as I suspect the impact would be minor and the maintenance much easier.   
Back to Top
BlackReefDesigns View Drop Down
Newbie
Newbie


Joined: 28-May-2008
Location: San Diego, CA
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote BlackReefDesigns Quote  Post ReplyReply Direct Link To This Post Posted: 25-June-2008 at 4:46am
Thanks Hamish
So, Im still a bit lost.  So I create both versions of the header/footer (wide and full) and place all 4 files in the PC folder?  I think I understand the concept but dont know how to go about plugging it in
Joe S.
BlackReef.net
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 25-June-2008 at 4:15am
OK,
  Using their same pseudo-code I would keep ONE set of folders and create two versions of header & footer.
headerW, footerW   & headerF, footerF

Then header.asp and footer.asp become a small strub of code like :-

If "fullscreen mode" then
        "include fullscreen header"
else
    "include widescreen header"
endif

That way, as they say, you only have to maintain 1 set of code. The footer.asp would be the same except choosing between the two versions of footer.
You could either havr the customer choose before entering, or, nicer IMHO have a graphic button in each header to allow them to toggle between the two versions. If you store the value in the cookie then they will always keep the version they have selected, until they decide to change it.


Back to Top
 Post Reply Post Reply Page  12>
  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.