Print Page | Close Window

How to set up seperate pages with header/footer

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Getting Started
Forum Description: Installing, activating, and getting started with ProductCart
URL: https://forum.productcart.com/forum_posts.asp?TID=1709
Printed Date: 14-May-2024 at 9:51am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to set up seperate pages with header/footer
Posted By: BlackReefDesigns
Subject: How to set up seperate pages with header/footer
Date Posted: 11-June-2008 at 10:32pm

Wanting to go with two seperate page formats:  Full Screen and Widescreen.  I was thinking about copying "store" directory and duplicating it, and naming one store directory "full" and the other "wide" and have a splash page where the user can choose widescreen or fullscreen.

 
For example, if the user chooses widescreen, it will take them to wide/pc/home.asp, while the full screen path will go full/pc/home.asp

Is this the best/easiest way to achieve this?  please advise
 
thanks
Joe


-------------
Joe S.
BlackReef.net



Replies:
Posted By: Hamish
Date Posted: 12-June-2008 at 5:20am
Hi Joe,
     That's a route I would really really avoid.
Having TWO copies of the code in a single site makes maintenance more of a headache.
Customers expect any width detection to happen automatically & there's plenty of code on the web to help do that.  If you want them to be able to choose then  perhaps use the same/similar method as is used on :
http://demotemplates.joomlashack.com/lightfast/ - http://demotemplates.joomlashack.com/lightfast/
(See the  ||  and <>  buttons on the right near the top ).

I would, off the top of my head, add code to header.asp to switch between the two versions.

I don't recall seeing any variable width ProductCart sites, and I haven't looked into it myself. - Actually, I've just done a small experiment & changed a site to a width of "90%" instead of a fixed 770px and, apart from the graphic in the header it looks fine.  


-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code



Posted By: BlackReefDesigns
Date Posted: 12-June-2008 at 5:58am
Thanks Hamish -
 
Do you know of any resources off the top of your head I could look into adding code to the header.asp?
 
The clients really want a widescreen version so I gotta figure something out  =)
 
Thanks


-------------
Joe S.
BlackReef.net


Posted By: Hamish
Date Posted: 12-June-2008 at 7:36am
Why not try a flexible width version.
To try it out set the  main table in your  header file  to, say,  :- 
<table width="90%"  align="center"  class="yourClass">

Take a look and see what the impact is.  If you have a header image across the width of the page which then looks wrong either change it to "blend" into the background, or set it to auto resize.
If your site is live then either try it on a test copy or you can use a copy of header.asp and, say, viewprd.asp and add TST (or whatever) to the front of the file names & amend TSTviewprd.asp to use TSTheader.asp so you can experiment on the "live" site without impacting live customers.

If you want to go the route of the example Joomla site, then you will have to examine the source code and javascript etc on their sample site.
Is the client going to pay you extra for creating two versions, or is it already in your contract?  (None of my business - no need to answer that one - it's just a thought)
 

-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code



Posted By: BlackReefDesigns
Date Posted: 25-June-2008 at 12:39am

Hamish -


The 'widescreen' format actually has a 100% table width, and the 'fullscreen' is only a 800px wide table.
 
anyways, I wrote this question to support:
 
I need to create a secondary web page. The clients want a Widescreen and Fullscreen version of the website, and I have created both pages, but obviously there can only be one Header/Footer.asp How can I set it up so I can use 2 different Header/Footer.asp files with the same page but different design layout?

I want to set it up so the customer has an option of selecting 'Widescreen' or 'Standard' on the splash page.

Example:
Widescreen = headerwide.asp, footerwide.asp

FullScreen = Header.asp, Footer.asp

I know the above won't work, but Im trying to illustrate what I need done. The only think I can think of doing would be to dupliate the entire PC folder and have the 2 links running to the two different folders, one PC folder having the widepage format, the other PC folder containing the Fullscreen

 
 
this is the response I had from ProductCart regarding this:
 
 
"A different folder is a good idea, but all you'd really need to do is to insert some logic which would go something like:

If "fullscreen mode" then "include fullscreen header"
elseif "widescreen mode" then "include widescreen header"
else "include regular header".

You can do this with folders also, but it would be better if you just had the IF statement above with the include for the different headers and footers.  "
 

not quite sure what that means, or where I would put the code, hehe. 



-------------
Joe S.
BlackReef.net


Posted By: Hamish
Date 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.




-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code



Posted By: BlackReefDesigns
Date 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


Posted By: Hamish
Date 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.   


-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code



Posted By: BlackReefDesigns
Date 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


-------------
Joe S.
BlackReef.net


Posted By: Hamish
Date 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


-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code



Posted By: BlackReefDesigns
Date 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 %>


-------------
Joe S.
BlackReef.net


Posted By: Hamish
Date 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.
 





-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code



Posted By: Hamish
Date 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.


-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code



Posted By: BlackReefDesigns
Date 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


Posted By: Hamish
Date 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 - http://www.w3schools.com/asp/asp_cookies.asp
Using Javascript to work with cookies :- http://www.w3schools.com/js/js_cookies.asp - 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.
 

-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net