Skip to content

Commit

Permalink
Fix #2814 — document template importing in shortcodes
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jun 5, 2017
1 parent 6c6096f commit 7a3fac8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/manual.txt
Expand Up @@ -1269,6 +1269,16 @@ variables in your shortcode template, with a caveat: Because of an unfortunate
implementation detail (a name conflict), ``data`` is called ``global_data``
when used in a shortcode.

If you have some template code that you want to appear in both a template and
shortcode, you can put the shared code in a separate template and import it in both
places. Shortcodes can import any template inside ``templates/`` and themes,
and call any macros defined in those.

For example, if you define a macro ``foo(x, y)`` in
``templates/shared_sc.tmpl``, you can include ``shared_foo.tmpl`` in
``templates/special_post.tmpl`` and ``shortcodes/foo.tmpl`` and then call the
``${shared_foo.foo(x, y)}`` macro.

The Global Context and Data files
---------------------------------

Expand Down

0 comments on commit 7a3fac8

Please sign in to comment.