Fractas\ShortcodableCodes\TwitterShortcode
Synopsis
class TwitterShortcode
extends ViewableData
{
- // constants
- const API_URL = 'https://publish.twitter.com/oembed';
- const API_VIDEO_URL = 'https://api.twitter.com/1.1/statuses/oembed.json';
- // members
- private static string $singular_name = 'Twitter Shortcode';
- private static string $plural_name = 'Twitter Shortcodes';
- // methods
- public mixed singular_name()
- public static string parse_shortcode()
- public Fieldlist getShortcodeFields()
- public string getShortcodePlaceHolder()
Hierarchy
Extends
- SilverStripe\View\ViewableData
Constants
Name | Value |
---|---|
API_URL | 'https://publish.twitter.com/oembed' |
API_VIDEO_URL | 'https://api.twitter.com/1.1/statuses/oembed.json' |
Members
private
- $plural_name
- $singular_name
Methods
public
- getShortcodeFields() — Returns a list of fields for editing the shortcode's attributes in the insert shortcode popup window.
- getShortcodePlaceHolder() — Returns a link to an image to be displayed as a placeholder in the editor In this example we make easy work of this task by using the placehold.it service But you could also return a link to an image in the filesystem - perharps the first image in this TwitterShortcode a placeholder.
- parse_shortcode() — Parse the shortcode and render as a string, probably with a template.
- singular_name()