Changes for page Embed

Last modified by 병곤 김 on 2026/10/06 04:54

From version 3.1
edited by 병곤 김
on 2026/10/06 04:52
Change comment: install embed wiki macro
To version 1.1
edited by 병곤 김
on 2026/10/06 04:50
Change comment: install embed wiki macro

Summary

Details

XWiki.WikiMacroClass[2]
Macro code
... ... @@ -1,12 +1,0 @@
1 -{{velocity}}
2 -#set($url = "$!xcontext.macro.params.url")
3 -#if($url == '')#set($url = "$xcontext.macro.content")#end
4 -#if($url.contains('youtube.com/watch') || $url.contains('youtu.be/'))
5 -#set($vid = '')
6 -#if($url.contains('v='))#set($vid = $url.substring($url.indexOf('v=') + 2))#if($vid.contains('&'))#set($vid = $vid.substring(0, $vid.indexOf('&')))#end#end
7 -#if($url.contains('youtu.be/'))#set($vid = $url.substring($url.indexOf('youtu.be/') + 9))#if($vid.contains('?'))#set($vid = $vid.substring(0, $vid.indexOf('?')))#end#end
8 -{{html}}<iframe width="560" height="315" src="https://www.youtube.com/embed/$vid" allowfullscreen="true"></iframe>{{/html}}
9 -#else
10 -{{html}}<a href="$escapetool.xml($url)">$escapetool.xml($url)</a>{{/html}}
11 -#end
12 -{{/velocity}}
Content description (Not applicable for "No content" type)
... ... @@ -1,1 +1,0 @@
1 -URL or content
Macro content availability
... ... @@ -1,1 +1,0 @@
1 -Optional
Macro description
... ... @@ -1,1 +1,0 @@
1 -Confluence compatibility: embed
Macro id
... ... @@ -1,1 +1,0 @@
1 -embed
Macro name
... ... @@ -1,1 +1,0 @@
1 -Embed
Supports inline mode
... ... @@ -1,1 +1,0 @@
1 -Yes
Macro visibility
... ... @@ -1,1 +1,0 @@
1 -wiki
XWiki.WikiMacroParameterClass[2]
Parameter description
... ... @@ -1,1 +1,0 @@
1 -url
Parameter mandatory
... ... @@ -1,1 +1,0 @@
1 -No
Parameter name
... ... @@ -1,1 +1,0 @@
1 -url
XWiki.WikiMacroClass[0]
Macro code
... ... @@ -1,0 +1,12 @@
1 +{{velocity}}
2 +#set($url = "$!xcontext.macro.params.url")
3 +#if($url == '')#set($url = "$xcontext.macro.content")#end
4 +#if($url.contains('youtube.com/watch') || $url.contains('youtu.be/'))
5 +#set($vid = '')
6 +#if($url.contains('v='))#set($vid = $url.substring($url.indexOf('v=') + 2))#if($vid.contains('&'))#set($vid = $vid.substring(0, $vid.indexOf('&')))#end#end
7 +#if($url.contains('youtu.be/'))#set($vid = $url.substring($url.indexOf('youtu.be/') + 9))#if($vid.contains('?'))#set($vid = $vid.substring(0, $vid.indexOf('?')))#end#end
8 +{{html}}<iframe width="560" height="315" src="https://www.youtube.com/embed/$vid" allowfullscreen="true"></iframe>{{/html}}
9 +#else
10 +{{html}}<a href="$escapetool.xml($url)">$escapetool.xml($url)</a>{{/html}}
11 +#end
12 +{{/velocity}}
Content description (Not applicable for "No content" type)
... ... @@ -1,0 +1,1 @@
1 +URL or content
Macro content availability
... ... @@ -1,0 +1,1 @@
1 +Optional
Macro description
... ... @@ -1,0 +1,1 @@
1 +Confluence compatibility: embed
Macro id
... ... @@ -1,0 +1,1 @@
1 +embed
Macro name
... ... @@ -1,0 +1,1 @@
1 +Embed
Supports inline mode
... ... @@ -1,0 +1,1 @@
1 +Yes
Macro visibility
... ... @@ -1,0 +1,1 @@
1 +wiki
XWiki.WikiMacroParameterClass[0]
Parameter description
... ... @@ -1,0 +1,1 @@
1 +url
Parameter mandatory
... ... @@ -1,0 +1,1 @@
1 +No
Parameter name
... ... @@ -1,0 +1,1 @@
1 +url