I am learning EE on the fly as I am creating our new corporate website in EE (at management's insistence) and I need to load different external js files depending on the template. I tried the approach below and the page in the browser doesn't show the variable as passing through even though the title variable comes through nicely.
Is there an error I don't see or is there a better way to do this?
I have a template named html_head.html coded as such:
<!DOCTYPE html>
<!--[if IE 7]> <html lang="en" class="ie7 no-js"> <![endif]-->
<!--[if IE 8]> <html lang="en" class="ie no-js"> <![endif]-->
<!--[if !IE]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta id="view" name="viewport" content="width=device-width, maximum-scale=1.0, minimum-scale=1.0, initial-scale=1" />
<title>{embed:page_title}</title>
<!-- Stylesheets -->
<link rel="stylesheet" href="{site_url}/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="{site_url}/bootstrap/css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="{site_url}/css/styles.min.css" />
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="{site_url}/js/respond.min.js"></script>
<script src="{site_url}/js/jquery-182.min.js"></script>
<script src="{site_url}/js/modernizr.js"></script>
<script src="{site_url}/bootstrap/js/bootstrap.min.js"></script>
<script src="{site_url}/js/page_scripts/{embed:page_script}.js"></script>
</head>
<body>
and I am calling this from other templates as such:
{embed="embeds/html_head" page_title="Company Name" page_script="home"}
But as mentioned page_title works but page_script doesn't. Any help is appreciated.
Thanks in advance!
{embed:page_script}
to work anywhere else in the template for testing purposes?