What snippets can I use?

Snippets allow you to customize content on your pages and in your mailings. You can see a full list of snippets that are available and how to use them in the documentation. Another way to look up what snippets are available on your page or mailing, we have a convenience tag called {% log_context %}.

To use {% log_context %} for pages, enter it in some portion of your page text like a statement lead in, then when you’re using the templateset previewer and check the Javascript console in your browser, you can see that there’s an object to leaf through and see what’s available.

{% log_context %} added in the About Text of a page. Note that this text won't appear on the page.
{% log_context %} added in the About Text of a page. Note that this text won’t appear on the page.
Using the templateset previewer, let's take a look at the page we just created, Save the Bees.
Using the templateset previewer, let’s take a look at the page we just created, Save the Bees.

Note that you won’t see the real data itself when using {% log_context %} – it’s intended as a “what’s snippets are available to use on this page or mailing” rather than a key-value store of all of the data. Each of the Object’s keys are the snippets you can use.

When previewing a page using the templateset previewer, check the Javascript console to see the Object created by log_context. Expand to see all of the snippets that are available.
When previewing a page using the templateset previewer, check the Javascript console to see the Object created by log_context. Expand to see all of the snippets that are available.

Whenever you see <type ‘instancemethod’>, that’s a sign that you could use a snippet to get more data from it. It’s an instancemethod (rather than the data itself) because we’re doing some work behind the scenes to generate or calculate that data, but at least you know what’s available.

You can also often use .as_dict to get a nice representation of the object (as a representation of a Python dictionary), like {{ page.as_dict }}.

To use {% log_context %} for mailings, include it in your mailing body and then check the Javascript console in your browser to find the object you’ll look through.

Once you've added {% log_context %} to your mailing body, check the Javascript console to see the Object created. Expand to see all of the snippets available.
Once you’ve added {% log_context %} to your mailing body, check the Javascript console to see the Object created. Expand to see all of the snippets available.

Interested in scheduling a demo with ActionKit? Let us know!