O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing the templates for the product detail page

Let's examine the product_detail_page.tmpl source file found in the shared/templates directory:

{{ define "pagecontent" }}{{template "product_detail_content" . }}{{end}}{{template "layouts/webpage_layout" . }}

This is the page template for the product detail page. Its primary purpose is to render the contents of the product_detail_content template and place it inside of the web page layout.

Let's examine the product_detail_content.tmpl source file found in the shared/templates directory:

<div class="productDetailContainer">  <div class="productDetailImageContainer">    <img src="{{.Product.ImagePreviewURI}}">  </div>  <div class="productDetailHeading">    <h1>{{.Product.Name}}</h1>  </div> <div ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required