Binary Lion Studios

I code for fun and for food.

Lift embed snippet execution failure

If you are getting an Execution Failure while trying to use the builtin embed snippet in Lift, you need to make sure the following are true:

  • the embedded template name must start with an underscore (ie: _sample.html)
  • do not include the .html extension on the name in the tag
  • make sure you have a top level tag in the embedded template that contains all the content For example, this is how to embed a template using designer friendly templates:
1
<div class="lift:embed?what=/templates-hidden/dashboards/_admin"></div>

Then the actual contents of the _admin.html template should look like this:

_admin.html
1
2
3
4
5
6
<div>
  <p>This is an admin template.</p>
  <div>
    ... other content/snippets here ...
  </div>
<div>

If you don’t put a top container around your embedded content, only the first node will get embedded.