Wiki Code Cookbook: Difference between revisions

From Portland NET Wiki
Line 100: Line 100:
=== Embed a video ===
=== Embed a video ===
In NETwiki, you can embed a video only from YouTube or Vimeo. Vimeo is the preferred NETwiki video source, since Vimeo doesn't make viewers watch ads. As most videos are not available on Vimeo, YouTube will do. The embed code for a video looks like this:
In NETwiki, you can embed a video only from YouTube or Vimeo. Vimeo is the preferred NETwiki video source, since Vimeo doesn't make viewers watch ads. As most videos are not available on Vimeo, YouTube will do. The embed code for a video looks like this:
<pre>
 
{{#ev:youtube|1S2nuZsBz8g|430|right|'''''Video: Exegesis addressing Kierkegaard's views on the meaning of life'''''|frame}}
[[File:Video Embed Code.png]]
</pre>
 
Let's go over each part of this phrase in Wiki syntax:
Let's go over each part of this phrase in Wiki syntax; each part is '''''required''''' for the code to post successfully and each part must be segregated by the "|" symbol. The numbers in magenta correspond to the list below:
 
# '''<nowiki>{{</nowiki>'''  Opening braces, and these will be the same any time someone is embedding a video.
# '''#ev:'''  these three characters set up the next part to name which video service will be used in the embed, either YouTube or Vimeo.
# '''youtube'''  this part should be completed according to which video service is going into the embed. In this example, it is YouTube.
# '''1S2nuZsBz8g'''  this is the most important part of the embed. It is the unique identifier for the video you plan to use.
# '''430''' this indicates the width of the video.
# '''Right''' this indicates where on the page the video will be aligned on the page. It can be right, left, or centered.
# This part of the phrase is the title of the video that anyone viewing the page will see.
# '''Frame'''  I don't know what this actually means, just don't leave it out.
# '''<nowiki>}}</nowiki>'''  closing braces.
 
In English, this phrase of code is saying (imagine in your best wiseguy voice): "Hey NETwiki. I got a video embed job for ya. I want you to go to YouTube, see? And look up a mook named 1S2nuZsBz8g. You bring him back here, tell him he gotta lay off the cannoli because he has to fit into a frame 430 pixels wide. Put him in a chair on the right side of the screen. And then we're gonna address him as 'Exegesis addressing Kierkegaard's views on the meaning of life', because that's his name now, see?"