Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

How can I create shortcodes?

Started by Muut Archive 9 years ago · 3 replies · 1192 views
9 years ago

For example, when I put on the page.MD [header-1] it would fetch from somewhere a predefined HTML code with a nice header.

9 years ago

Also, it would be possible to create more advanced shortcodes ie.:
page.md: [header="Header Text"] or [header="Header Text","description"]?

9 years ago

Forgot about those advanced options, all I need is simple shortcodes as I mentioned in the first post.

9 years ago

Take a look at the shortcode-core plugin. In that there are several shortcode examples contained in the shortcodes/ folder.

Then take a look at the shortcode-ui plugin. This takes advantage of the shortcode-core plugin to extend it with more custom short codes. Based on these you would be able to create your own shortcode plugin.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1346 9 years ago
Archive · by Muut Archive, 9 years ago
2 933 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2945 9 years ago
Archive · by Muut Archive, 9 years ago
3 1117 9 years ago