Hi
I am trying to construct a ‘re-useable’ head section that can mostly be used cross site and on different pages. The idea is to split the head section into different sections that can be called by a php include().
First I would use a php include to add the common global settings:-
<head>
<!-- Global meta tags -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<!-- Favicon for shortcut and browser tab -->
<link rel="shortcut icon" type="image/png" href="img/web-design.png"/>
<!-- Global CSS links -->
<link rel="stylesheet" href="css/bootstrap.min.css">
Then I would manually type in the page
<!-- Page specific meta tags entered directly into html page -->
<meta name="description" content="My Description">
<meta name="author" content="My Author">
<meta name="keywords" content="My Keywords">
<title>My Title</title>
<!-- Custom page specific css entered directly into page html -->
<link rel="stylesheet" href="css/fullscreen.css">
<link rel="stylesheet" href="css/button.css">
</head>
Then when loaded the page code would look as follows:-
<head>
<!-- Global meta tags -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<!-- Favicon for shortcut and browser tab -->
<link rel="shortcut icon" type="image/png" href="img/web-design.png"/>
<!-- Global CSS links -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Custom site CSS links -->
<link rel="stylesheet" href="css/custom.css">
<link href='https://fonts.googleapis.com/css?family=Kalam' rel='stylesheet'>
<!-- Page specific meta tags entered directly into html page -->
<meta name="description" content="My Description">
<meta name="author" content="My Author">
<meta name="keywords" content="My Keywords">
<title>My Title</title>
<!-- Custom page specific css entered directly into page html -->
<link rel="stylesheet" href="css/fullscreen.css">
<link rel="stylesheet" href="css/button.css">
</head>
In this way I can save a lot of coding and easily make global changes and still be able to change page specific settings - the downside is links and meta are a bit mixed up -
It seems to work ok but are there any problems with this idea or the general syntax - thanks
any advice or ideas greatly appreciated