Include header section on ReactLayout Templates


#1

Say I have the following:

<head>
	<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
	<meta charset="utf-8"/>
	<title>Meteor Admin</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
	<link rel="apple-touch-icon" href="/ico/60.png">
	<link rel="apple-touch-icon" sizes="76x76" href="/ico/76.png">
	<link rel="apple-touch-icon" sizes="120x120" href="/ico/120.png">
	<link rel="apple-touch-icon" sizes="152x152" href="/ico/152.png">
	<link rel="icon" type="image/x-icon" href="favicon.ico"/>
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-touch-fullscreen" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="default">
	<meta content="" name="description"/>
	<meta content="" name="author"/>
</head>

<body class="fixed-header ">
</body>

How do I ensure that is always included in my React Template? Blaze had a master template which could take such but most of the react examples I have seen start rendering on the ‘component’ itself.

Does this work if it’s used within say app.html which is included on the /client/views? What is the best way to achieve my goal?


#2

Pardon me as I’m still a bit of a n00b with React, but if you have a file client/main.html that contains the HTML above, except with a bit of a modification:

<body class="fixed-header">
  <div id="app"></div>
</body>

…and then if you React.render(<App />, document.getElementById('app')), then the HTML head content should always be there.


#3

I forgot to mention that I am using ReactLayout in my project and as stated in this section, you really don’t specify an element it for the render div. How can I work around this?