Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

different header and footer


Guest

Recommended Posts

Hi all,

 

I need to display a different header and footer for every section/category of my site, ideally I would prefer to control this feature from the admin section, but I static solution would be just as effective. For example before uploading content to a section, I would ideally like the option to assign a header or/and footer to a page or category of my site. I?ve tried looking for a solution over the last week or so, but have failed to come up with anything.

 

 

Any help would very much be appreciated!

Link to comment
Share on other sites

Hi all,

 

I need to display a different header and footer for every section/category of my site, ideally I would prefer to control this feature from the admin section, but I static solution would be just as effective. For example before uploading content to a section, I would ideally like the option to assign a header or/and footer to a page or category of my site. I?ve tried looking for a solution over the last week or so, but have failed to come up with anything.

Any help would very much be appreciated!

 

add a header and a footer field to the category table.

fill those with the header and footer html you require for that category.

if it is language dependant, put those fields in the category description table.

 

in header.php you select the header given the category id and display the contents, same in footer.php.

Treasurer MFC

Link to comment
Share on other sites

add a header and a footer field to the category table.

fill those with the header and footer html you require for that category.

if it is language dependant, put those fields in the category description table.

 

in header.php you select the header given the category id and display the contents, same in footer.php.

 

sorry, if you have some free time can you give me an example of what you have explained?

Link to comment
Share on other sites

Thanks for help Amanda!

 

 

Just so these no misunderstanding and I don?t waist anybody?s time in attempting help me, I?ll explain in another way what I need this feature to do:

 

Lets say I have a box on the site named ?information? containing a number of links that were created using a article contribution.

 

When clicking on one of the links in the ?information? box it would take me to the following address

http://www.mysite.com/articles.php?tPath=2

and display it?s own header and footer to brand that section of the site.

 

And now I select another link within the ?information? box which would me to?

http://www.mysite.com/articles.php?tPath=2

I would hope this to also display its own header and footer to brand that section of the site.

 

I hope you can help!

Link to comment
Share on other sites

Thanks for help Amanda!

Just so these no misunderstanding and I don?t waist anybody?s time in attempting help me, I?ll explain in another way what I need this feature to do:

 

Lets say I have a box on the site named ?information? containing a number of links that were created using a article contribution.

 

When clicking on one of the links in the ?information? box it would take me to the following address

http://www.mysite.com/articles.php?tPath=2

and display it?s own header and footer to brand that section of the site.

 

And now I select another link within the ?information? box which would me to?

http://www.mysite.com/articles.php?tPath=2

I would hope this to also display its own header and footer to brand that section of the site.

 

I hope you can help!

 

but these pages are the same.

 

anyway, for article topics you would need to put the fields in the topics table

Treasurer MFC

Link to comment
Share on other sites

but these pages are the same.

 

anyway, for article topics you would need to put the fields in the topics table

 

 

sorry it should have been...

 

 

When clicking on one of the links in the ?information? box it would take me to the following address

http://www.mysite.com/articles.php?tPath=2

and display it?s own header and footer to brand that section of the site.

 

And now I select another link within the ?information? box which would me to?

http://www.mysite.com/articles.php?tPath=4

I would hope this to also display its own header and footer to brand that section of the site.

Link to comment
Share on other sites

 

Amanda wrote in post 2

add a header and a footer field to the category table.

fill those with the header and footer html you require for that category.

if it is language dependant, put those fields in the category description table.

 

in header.php you select the header given the category id and display the contents, same in footer.php.

 

but I don't understand the instructions she has written, can someone please expand on this please as I'm in a little bit of a hurry to get this completed.

Link to comment
Share on other sites

I am not sure how to do it myself but I wanted to throw in my 2 cents... although you will be catering to younger people unless the header and footer differences are really really important I would suggest keeping them the same and just adding different information a different way. People tend to get confused when pages don't flow and look different, thinking they have gone to another website. Pretty sure youger people wont have that problem as often as older people would but it is something to consider.

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

I am not sure how to do it myself but I wanted to throw in my 2 cents... although you will be catering to younger people unless the header and footer differences are really really important I would suggest keeping them the same and just adding different information a different way. People tend to get confused when pages don't flow and look different, thinking they have gone to another website. Pretty sure youger people wont have that problem as often as older people would but it is something to consider.

 

 

I'm sorry but i never stated I'd be catering for yonger people, but thanks for the advice!

Link to comment
Share on other sites

Amanda wrote in post 2

but I don't understand the instructions she has written, can someone please expand on this please as I'm in a little bit of a hurry to get this completed.

 

current setup of a normal page:

 

include header php file

write the body

include footer php file

 

those header and footer files are reasonably static.

so if you want them dynamic and category dependant, then you add the html for the header and the footer to the category table. that way every category can have its own header and footer.

 

then in the header.php file, you select that header data from the table for the specific category you are displaying and echo out the data.

 

you do the same with the footer.

 

so in the header :

 

if we are displaying a category page {

select the header data from the category table where the category id = the given one.

if the header data is not empty {

echo out the header data

} else {

include the default header

}

}

 

and in the footer :

 

if we are displaying a category page {

select the footer data from the category table where the category id = the given one.

if the footer data is not empty {

echo out the footer data

} else {

include the default footer

}

}

Treasurer MFC

Link to comment
Share on other sites

I'm not really sure of what I'm doing so I will probable have to skip this feature as I can't spend any more time trying to develop this. It's not that I'm giving, but I'm not a programmer and I?ve to much time trying to find a solution for this problem.

 

<?php

 

if ((DIR_WS_INCLUDES == 'true') {

 

echo ();

 

} else {

 

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

 

}

Link to comment
Share on other sites

Carl, with your knowledge of programming you are not going to be able to do this dynamically. And, unfortunately, no one here is going to write the whole thing out for you. We help and advise people here on how to do things for themselves, and if it's a matter of a small piece of coding we'll provide the code. However, this is not a matter of a small piece of coding.

 

If you want to have different headers and footers which are not dynamically linked to cPaths then you can do it for static pages by setting up different headers and footers (e.g. header1.php, header2.php) and just change the 'includes' for the header on the static page.

 

Vger

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...