Skip to content

Commit 1fd0bd1

Browse files
committed
More documentation
1 parent cf67608 commit 1fd0bd1

1 file changed

Lines changed: 68 additions & 1 deletion

File tree

README.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,79 @@ Where the `@task@` is either `build` or `watch`.
6262
* The `build` task builds the project.
6363
* The `watch` task will launch a task that watches for file changes; the project is then automatically built if a source file is modified.
6464

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.
82+
83+
For example:
84+
85+
<txp::superseded type="shortcodes" location="https://example.com/example.html" />
86+
87+
### Image
88+
89+
To create a HTML5 image snippet:
90+
91+
<txp::media_image id="" dark-option="" set-width="" set-height="" />
92+
93+
`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:
104+
105+
<txp::media_image id="51" dark-option="52" set-width="400" set-height="125" />
106+
107+
### Video
108+
109+
To create a HTML5 video snippet:
110+
111+
<txp::media_video width="" height="" mp4-url="" webm-url="" poster-url="" name="" description="" duration-seconds=""/>
112+
113+
`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" />
118+
119+
### File
120+
121+
To create a file download snippet:
122+
123+
<txp::media_file category="" filename="" large-button="" />
124+
125+
`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.
128+
129+
For example:
130+
131+
<txp::media_file category="current-release-zip" sha256="a868c05fc37108f2bb5e878cfbcdc61a82ce2646c4676cccb8105a6c6277be7a" />
132+
65133
## Plugins used
66134

67135
All plugins we use are installed via Composer:
68136

69137
* [`etc_cache`](https://github.com/etc-plugins/etc_cache) ✓ Composer
70-
* [`rah_custom_feed`](https://github.com/gocom/rah_custom_feed) ✓ Composer
71138
* [`smd_thumbnail`](https://github.com/bloke/smd_thumbnail) ✓ Composer
72139

73140
## License

0 commit comments

Comments
 (0)