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
@@ -6,6 +6,40 @@ The **Shortcode Core** plugin allow for the development of simple yet powerful s
6
6
7
7
This plugin uses the [Thunderer Advanced shortcode engine](https://github.com/thunderer/Shortcode). For more information please check out that repo on GitHub.
8
8
9
+
## Available Shortcodes
10
+
11
+
The Shortcode Core plugin provides the following built-in shortcodes:
12
+
13
+
### Text Formatting
14
+
-**[Underline](#underline)** - Underline text
15
+
-**[Size](#font-size)** - Change font size
16
+
-**[Color](#color)** - Change text color
17
+
-**[Mark](#mark)** - Highlight/mark text
18
+
19
+
### Text Alignment
20
+
-**[Left](#left-align)** - Left align text
21
+
-**[Center](#center-align)** - Center align text
22
+
-**[Right](#right-align)** - Right align text
23
+
24
+
### Containers
25
+
-**[Div](#div)** - Wrap content in a div with classes/id
26
+
-**[Span](#span)** - Wrap content in a span with classes/id
Supports h1 through h6 with any combination of id and class attributes.
225
+
178
226
#### Span
179
227
180
228
Allows you to wrap markdown in an HTML `span` tag that supports both `id` and `class` attributes
@@ -183,6 +231,10 @@ Allows you to wrap markdown in an HTML `span` tag that supports both `id` and `c
183
231
[span class="text-center"]
184
232
This text is **centered** aligned
185
233
[/span]
234
+
235
+
[span id="important" class="highlight"]
236
+
This is **important** highlighted text
237
+
[/span]
186
238
```
187
239
188
240
#### Columns
@@ -432,28 +484,43 @@ Lorem ipsum dolor sit amet...
432
484
433
485
**Note:** The show/hide behaviour is not supported in IE 11 or Edge 18, and the element will be permanently open. You can check the current status of browser compatibility at [Can I Use](https://caniuse.com/#search=details).
434
486
487
+
### Special Functions
488
+
435
489
#### Lorem Ipsum
436
490
437
491
Useful for faking content, you can use a shortcode to quickly generate some random "lorem ipsum" text:
438
492
439
493
**Paragraphs:**
440
494
```
441
-
[lorem=5 /]
442
-
443
-
[lorem p=5 tag=div /]
495
+
[lorem=5 /] # 5 paragraphs (shorthand)
496
+
[lorem p=5 /] # 5 paragraphs
497
+
[lorem p=5 tag=div /] # Wrap each paragraph in div tags
498
+
[lorem p=3 tag=p /] # Wrap each paragraph in p tags
444
499
```
445
500
446
501
**Sentences:**
447
502
```
448
-
[lorem s=4 /]
503
+
[lorem s=4 /] # 4 sentences
504
+
[lorem sentences=10 /] # 10 sentences
449
505
```
450
506
451
507
**Words:**
452
508
```
453
-
[lorem w=35 /]
509
+
[lorem w=35 /] # 35 words
510
+
[lorem words=50 /] # 50 words
454
511
```
455
512
456
-
## Using Shortcodes in Twig
513
+
**Options:**
514
+
-`p` or `paragraphs` - Number of paragraphs to generate
515
+
-`s` or `sentences` - Number of sentences to generate
516
+
-`w` or `words` - Number of words to generate
517
+
-`tag` - HTML tag to wrap each paragraph (only for paragraph mode)
518
+
519
+
The shorthand format `[lorem=X /]` defaults to generating X paragraphs.
520
+
521
+
## Advanced Usage
522
+
523
+
### Using Shortcodes in Twig
457
524
458
525
You can now use shortcodes in Twig templates and process them with the `|shortcodes` filter. For example:
459
526
@@ -462,7 +529,7 @@ You can now use shortcodes in Twig templates and process them with the `|shortco
462
529
{{ twig_text|shortcodes }}
463
530
```
464
531
465
-
## Custom Shortcodes
532
+
###Custom Shortcodes
466
533
467
534
### Simple Way
468
535
@@ -550,7 +617,7 @@ The best way to see how to create a new shortcode-based plugins is to look at th
0 commit comments