Script Function - fatsecret.writeHolder(section)

Description

If the auto_template script URL parameter is set to "false", the predefined templates will not be loaded and you will have to provide your own layout for each canvas. This provides one way to set up the canvas content (the other being fatsecret.addRef).
fatsecret.writeHolder will directly write out the specified section (see Canvas Reference for the complete section list for each canvas).

Parameters

Required

Name Type Description
section String The name of the section to load.

Example

Setting up a simple layout for the food.get canvas.
<script src="https://platform.fatsecret.com/js?key=XXXXX&auto_template=false"></script>

<script>fatsecret.writeHolder("search");</script>
<script>fatsecret.writeHolder("foodtitle");</script>
<script>fatsecret.writeHolder("nutritionpanel");</script>
Figure 1: Using fatsecret.writeHolder to set up a custom layout for the food.get canvas
FatSecret Sites
For Developers

For Professionals

For Everyone

FatSecret Platform API

Support
API

About FatSecret

© 2021 FatSecret. All rights reserved.