You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+68-1Lines changed: 68 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,12 +62,79 @@ Where the `@task@` is either `build` or `watch`.
62
62
* The `build` task builds the project.
63
63
* The `watch` task will launch a task that watches for file changes; the project is then automatically built if a source file is modified.
64
64
65
+
## Shortcodes
66
+
67
+
Textpattern 4.7 introduced support for user-definable `<txp:output_form />` attributes (and also the short tags syntax `<txp::...>`), allowing for our own version of 'shortcodes' within articles (**note:** remember to also use `notextile.` when within Textile content). This site uses the following tags:
68
+
69
+
### Superceded plugin flag
70
+
71
+
Plugins can be flagged as 'superseded' when there is deemed a better method to achieve the same end task. For example, newer core Textpattern tags/attributes have been developed, a more modern alternative plugin, or if Textpattern [custom short-tags and shortcodes](https://docs.textpattern.com/tags/shortcodes/custom-short-tags-and-shortcodes) can be used instead.
72
+
73
+
The shortcode creates an alert block on the page showing an advisory listing the new method and a link to the new methods' documentation.
74
+
75
+
To create a superceded plugin flag:
76
+
77
+
<txp::superseded type="" location="" />
78
+
79
+
`type` is used to explain the replacement method that is available. For example, `shortcodes`, `alterntaive plugin`, `core tags`, etc. Please try to keep the naming convention consistent throughout the CMS if possible.
80
+
81
+
`location` is the *full URL* to the replacement method; be that documentation and/or examples via shortcodes, the webpage of the alterntaive plugin, the documentation page of the core tags, etc.
`id` accepts either a single image ID, or comma separated image IDs if you want multiple images. For blogs/articles the ideal image width is `832` pixels for the standard resolution version and `1664` pixels for the double resolution version (which is optional, but should be provided if possible).
94
+
95
+
`dark-option` is optional (for a single image ID), for if you need to provide an alternative image when website is in Dark Mode.
96
+
97
+
`set-width` and `set-height` are optional (for a single image ID), for if you need to provide explicit maximum dimensions (in pixels) for an image. Otherwise (when not set), images default to being fully responsive (expanding to fill their container).
98
+
99
+
For example, comma separated image IDs:
100
+
101
+
<txp::media_image id="41, 42, 50" />
102
+
103
+
For example, image with an alternative dark theme version and a set width and height in pixels:
`poster-url`, `name`, `description` and `duration-seconds` are optional, but should be provided if possible to provide valid Schema.org microdata. If not used, remove those attributes from your shortcode.
114
+
115
+
For example:
116
+
117
+
<txp::media_video width="640" height="480" mp4-url="/video/video1.mp4" webm-url="/video/video1.webm" poster-url="/video/video1-poster.png" name="Cat video" description="My great video of cats." duration-seconds="20" />
`category` and `filename` are interchangeable (use one or the other, where appropriate) - if both are provided then `category` is used in preference and `filename` is ignored.
126
+
127
+
`large-button` is optional. If set to `1`, this will render a larger style button.
0 commit comments