View Full Version : Global header
At the moment each of my pages (eg. PROD) has a <HEAD> section then the <BODY> starts and then it calls the global header, eg.
<head>
...stuff...
</head>
<mvt:item name="body">
<mvt:item name="hdft" param="global_header" />
...more stuff...
As I designed the site ages ago I can't remember if it was like this or if I did it like this for some reason...
This seems very bizarre - is this normal or have I been playing? :D
DesignExtend-MSI
03-31-06, 06:15 PM
No, that looks right. Unlike MM4, the templates include the head/body tags.
ILoveHostasaurus
03-31-06, 06:15 PM
That would be normal, the head tag always comes before body and in Merchant, the global header is always html that comes above the table that the store is housed in but within the body so that you can type html code into it.
but doesn't that mean that if you have a peice of code that has to go into the <head> section you would have to paste it into every single page? Doesn't that defeat the object of having a global header...?
Would the following work -
Change the global header to
<HEAD>...stuff...</HEAD>
<BODY>
then change the top of each page to -
<mvt:item name="hdft" param="global_header" />
ok, so you'd still have to change every single page - but you'd only have to do it once and not everytime you think of something new for the <HEAD> section!
ILoveHostasaurus
03-31-06, 06:30 PM
That's a very good idea, yes, that should work. Only downside is that if you ever needed to have special head tag code on certain pages, then you'd have to move your whole global header into that page and remember to update it when you update the main global header. :)
Vic - WolfPaw Computers
03-31-06, 06:30 PM
Global headers in Merchant have never included content above the opening <BODY> tag.
OpenUI however, did permit inclusion of information to be inserted in the head, title, meta, and body tags...
Merchant out of the box, does not.
DesignExtend-MSI
03-31-06, 06:35 PM
Global headers in Merchant have never included content above the opening <BODY> tag.
OpenUI however, did permit inclusion of information to be inserted in the head, title, meta, and body tags...
Merchant out of the box, does not.
In version 4, correct. But not in version 5.
Vic - WolfPaw Computers
03-31-06, 06:39 PM
Thank you for correcting me Pamela.
That is correct, MM5 did incorporate for Head & Body tag inserts in the MM5 product just like OUI offered in MM4.
Small oversight on my part :D
cool, so my idea should work then?
DesignExtend-MSI
03-31-06, 06:49 PM
cool, so my idea should work then?
Yes, it will. Barring what David said about different head tags you may need to run on different pages. If that's not an issue, then you'll be fine.
Vic - WolfPaw Computers
03-31-06, 07:15 PM
And if you did need different headers, you could alway incorporate a conditional to display the needed information based on which screen you are displaying.
I may be missing something, but if you had a piece of code that had to go on every page, why wouldn't you put it in the HEAD tag content section under your store name? Then you still have full options to put page specific information on individual pages without having to mess with conditionals.
Vic - WolfPaw Computers
03-31-06, 09:28 PM
I should have been more clear in my reply...
Only downside is that if you ever needed to have special head tag code on certain pages, then you'd have to move your whole global header into that page and remember to update.
ILoveHostasaurus
04-01-06, 03:23 AM
I may be missing something, but if you had a piece of code that had to go on every page, why wouldn't you put it in the HEAD tag content section under your store name? Then you still have full options to put page specific information on individual pages without having to mess with conditionals.
We're referring to specific content that should only be on certain pages. A good example would be conversion tracking or purchase feedback submittal code that should only appear on the invoice page but which has components that need to appear in the head tag.
We're referring to specific content that should only be on certain pages. A good example would be conversion tracking or purchase feedback submittal code that should only appear on the invoice page but which has components that need to appear in the head tag.
Right, I understand that. But the original question was:
but doesn't that mean that if you have a peice of code that has to go into the <head> section you would have to paste it into every single page? Doesn't that defeat the object of having a global header...?
My point is that no, you wouldn't have to paste it into every single page. Pieces of code that have to go in the head section of each page should be inserted in the global HEAD Tag Content section. They are then called into the <head> section of each page like so:
<head>
<mvt:item name="head" />
</head>
Pages that required special codes such as the conversion tracking would then have those codes inserted into the <head> tag for that specific page. Incorporating the <head> tag into the global header just isn't necessary when the <head> tag has its own global item for codes that have to be displayed on all pages, and yet can be so easily customized on individual pages by leaving the <head> tag as part of the page template.
Or do I still just not understand?
My point is that no, you wouldn't have to paste it into every single page. Pieces of code that have to go in the head section of each page should be inserted in the global HEAD Tag Content section. They are then called into the <head> section of each page like so:
<head>
<mvt:item name="head" />
</head>
The problem with that is that the global header contains a <BODY> tag as well, as the global header includes things like the banner/top menu so your code would end up with two <BODY> tags and one inside the </HEAD>...
My original point was that the way it was done was a bit silly (having a global header that had no <HEAD></HEAD> tags and then calling the global header from within the body). It makes more sense for me to have a global header that is the beginning bit of the code (<HEAD></HEAD><BODY>) and all the other pages are stuck on the end - then as you say one change to the header covers the entire site.
And as everyone seems to agree my solution would work I will implement it today...:D
ooooooooh wait. I see what your saying. There is another field called 'HEAD tag content'.... ok, if that does what I think it does then that would explain a few things and mean my fix isn't necessary... and that my previous reply is nonsense as I thought you meant the global header... :D
Actually, as I've been going through tidying up (putting the head code from the pages into the HEAD tag section) I've noticed that the pages I've never touched look like this -
<html>
<head>
<title>....</title>
<base href="&mvt:global:basehref;">
<mvt:item name="head" />
</head>
(The pages that were modified had been changed a lot and didn't look like this, so I assume this is what the 'default' code looks like...)
So I'm just wondering why the base ref is on each page and not in the HEAD tag section which is called below it...? Does that variable change per page? and if so does it make a difference if it is in the head tag section rather than in the head tag part of the page...? are they 'compiled' at different times and therefore will give different results based on where the variable is located? am I making any sense whatsoever?
vBulletin® v3.7.4, Copyright ©2000-2008, Jelsoft Enterprises Ltd.