Posted on 04/05/2016 10:32:28
I am just trying to get product number and product image path on master template.
please see the template below
<!DOCTYPE html>
<html lang='@GetGlobalValue("Global:Area.Lang")'>
<head>
<title></title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
@if (!string.IsNullOrEmpty(GetString("Title")))
{
<meta property="og:title" content='@GetString("Title")' />
}
@if (!string.IsNullOrEmpty(GetString("Meta.Description")))
{
<meta property="og:description" content='@GetString("Meta.Description")' />
}
@{
var url = GetGlobalValue("Global:Request.Host");
var imagetag = GetString("Item.OpenGraphImage.Value");
var productImage = string.Empty;
if (!string.IsNullOrEmpty(GetString("Ecom:Product.ImageLarge.Clean")))
{
productImage = GetString("Ecom:Product.ImageLarge.Clean");
}
else
{
productImage = string.Format("/Files/Images/ecom/products/large/{0}.jpg", GetString("Ecom:Product.Number"));
}
var pno = GetString("Ecom:Product.ID");
}
@if (!string.IsNullOrEmpty(GetString("Item.OpenGraphImage")))
{
<meta property="og:image" content='http://@url/@imagetag' />
}
<meta property="og:image" content='http://@url/@productImage' />
<meta property="og:image" content='http://@url/@pno' />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css' media="all" />
<link href="/assets/stylesheets/layout.css" rel="stylesheet" media="all" type="text/css" />
<link href="/assets/stylesheets/print.css" rel="stylesheet" media="print" type="text/css" />
@RenderSnippet("StyleSheet")
<!--[if lt IE 9]>
<script src="@GetString("Template:DesignBaseUrl")vendor/assets/javascript/lib/respondjs/respond.min.js" type="text/javascript"></script>
<![endif]-->
<script data-main='@GetString("Template:DesignBaseUrl")assets/javascript/solutionset.init' src="/vendor/assets/javascript/lib/requirejs/require.min.js" type="text/javascript"></script>
</head>
@IncludeFile("Partials/Background.cshtml")
<body style="@(!string.IsNullOrEmpty(backgroundImage) ? backgroundImage : null)">
<div id="master-wrapper">
<div id="header-wrapper">
<div id="header" class="container">
<div id="header-content" class="row">
<div id="header-logo" class="col-xs-12 col-sm-7 col-md-7 col-lg-8">
<a href="/"><img src='/..@GetString("Item.Area.Header_Logo")' alt="Logo" /></a>
</div>
</div>
</div>
</div>
<div id="navigation-wrapper">
<div id="navigation" class="container">
@IncludeFile("Partials/NavigationMain.cshtml")
</div>
</div>
<div id="content-wrapper">
@ContentPlaceholder()
</div>
<div id="footer-wrapper">
<div id="footer" class="container">
<div id="footer-content" class="row">
<div id="footer-copyright" class="col-xs-12">
@GetValue("Item.Area.Footer_Copyright")
</div>
</div>
</div>
</div>
</div>
</body>
</html>