Toto je starší verze dokumentu!
Shortcodes
You can use several shortcodes throughout the site. Some modules are better implemented using the Page Builder rather than shortcodes, but both uses are supported
Shortcodes use attributes, some are optional, some are required. We will use the following syntax to specify required and optional attributes:
[shortcode-name required='this|that' required='%d' optional='%s']
- this|that means you can either use „this“ or „that“
- %d represents a number
- %s represents a piece of text
Some shortcodes (Button for example) can have content (i.e. the text you see inside the button.) These are used like this:
[shortcode-name attributes]Content of the shortcode[/shortcode-name]
General use of post IDs when inserting a shortcode
Some of the shortcodes embed other posts or components from the administration. Usually you need to know the ID of the post/component before you embed it with shortcode.
You can see the ID in the address bar of your browser
The ID is specified by post={NUMBER}. From the screenshot you can see the ID is 137643
Note: We now have experimental buttons in the editor toolbar which you can use to select the correct post instead of knowing the ID
Annotation
Shortcode: [annotation id='%d'] where %d represents the ID of an annotation
You can have a look at embeding annotations the standard way
Live Feed
Shortcode: [live-feed id='%d'] where %d represents the ID of a live feed
You can have a look at embeding live feeds the standard way
Post Teaser
Shortcode: [post-teaser id='%d'] where %d represents the ID of a post or event
You can have a look at embeding post teasers the standard way
Button
Shortcode: [button type='dark|green' title='%s' url='http://www.google.com' target='blank|%s']%s[/button]
Both of these will do the same: [button]Some Text[/button] or [button text="Some Text"] - but be careful, if you use the short version [button text="Some Text"] and then later you use the long version [button]Some Text[/button] it will break the page, because it will read the shortcode as one - beginning with [button text="Some Text" and ending with Some Text[/button]. So if you need multiple buttons on the same page, always use the long version
Type
Specifies the type of the button. Either dark or green can be used:
Title
Title is displayed when the user hovers mouse over the button
Url
If the button has URL, it will create a link to that page
Target
If the button has URL, it will be opened in the same window. You can specify a target window to open it in a new one - „blank“ is usually used unless you well know what you are doing.
Examples
[button]Hello2you[/button]
[button url='http://www.google.com' type='green']Google[/button]
[button url='http://www.google.com']
[button type='green' text='Goodbye2you']
Examples
[button]Some Text[/button]
[button url='http://www.google.com']
[button url='http://www.google.com']Google[/button]
[button type='green' text='Hello2you']
IFrame
Shortcodes: [skoda-iframe src='http://www.google.com']