Update extending.md
This commit is contained in:
parent
75d1663c9b
commit
64b0d4cf06
@ -85,7 +85,7 @@ CMS.registerEditorComponent({
|
|||||||
// Fields the user need to fill out when adding an instance of the component
|
// Fields the user need to fill out when adding an instance of the component
|
||||||
fields: [{name: 'id', label: 'Youtube Video ID', widget: 'string'}],
|
fields: [{name: 'id', label: 'Youtube Video ID', widget: 'string'}],
|
||||||
// Pattern to identify a block as being an instance of this component
|
// Pattern to identify a block as being an instance of this component
|
||||||
pattern: /youtube (\S+)\s/,
|
pattern: /^{{<\s?youtube (\S+)\s?>}}/,
|
||||||
// Function to extract data elements from the regexp match
|
// Function to extract data elements from the regexp match
|
||||||
fromBlock: function(match) {
|
fromBlock: function(match) {
|
||||||
return {
|
return {
|
||||||
@ -94,7 +94,7 @@ CMS.registerEditorComponent({
|
|||||||
},
|
},
|
||||||
// Function to create a text block from an instance of this component
|
// Function to create a text block from an instance of this component
|
||||||
toBlock: function(obj) {
|
toBlock: function(obj) {
|
||||||
return 'youtube ' + obj.id;
|
return '{{< youtube ' + obj.id + ' >}}';
|
||||||
},
|
},
|
||||||
// Preview output for this component. Can either be a string or a React component
|
// Preview output for this component. Can either be a string or a React component
|
||||||
// (component gives better render performance)
|
// (component gives better render performance)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user