Add documentation for the .HasShortcode function

This commit is contained in:
Oliver 2018-01-10 18:36:14 +01:00 committed by Bjørn Erik Pedersen
parent 919af9071b
commit 050ccd12b7

View File

@ -137,6 +137,10 @@ You can also use the variable `.Page` to access all the normal [page variables][
A shortcodes can also be nested. In a nested shortcode, you can access the parent shortcode context with [`.Parent` variable][shortcodesvars]. This can be very useful for inheritance of common shortcode parameters from the root.
### Checking for Existence
You can check if a specific shortcode is used on a page by calling `.HasShortcode` in that page template, providing the name of the shortcode. This is sometimes useful when you want to include specific scripts or styles in the header that are only used by that shortcode.
## Custom Shortcode Examples
The following are examples of the different types of shortcodes you can create via shortcode template files in `/layouts/shortcodes`.