- Note: This tutorial applies to dedecms v5.3, v5.5, v5.6, and v5.7. Sometimes, in order to better display the content of the website's body, we need to introduce some videos, but the editor provided by zhimeng does not directly support the reference of Youku and other video websites. This tutorial explains how to add a tutorial on the dedecms system, for example, the Youku website. It consists of several steps: Add Youku SWF address to the model Custom Field add Youku reference code Add 1. Implementation Method As we mentioned earlier, the built-in editor does not support this effect. Then we can use the dedecms Content Model to implement it. Here we create it based on the default Article model (if you are using another new model, the method is the same) 1) add custom fields of the Model Go to the background, click "core"> "channel model"> "content model management", and click "modify" next to "Common Article". Then, switch to "Field Management". click [add new field]. The information is as follows: Add and save the settings. 2) Add Youku SWF address Add the SWF address of Youku to play the content page. Of course, the method is to add a document for this model. Here is a general article. The information we add is as follows: Pay attention to the SWF address of the red background in the figure above. It is manually extracted from the Youku playback page. For example, in the http://v.youku.com/v_show/id_XMjA4MDk4MjQw.html page, it is extracted: 3) add Youku reference code
Open our current Content Page Template and add the following code on the {Dede: field. Body/} line: Collapse the XML/html code and copy the content to the clipboard. <Embed Type = "application/X-Shockwave-flash" Src = "{Dede: field. ykswf /}" Id = "movie_player" Name = "movie_player" Bgcolor = "# ffffff" Quality = "high" Allowfullscreen = "true" Flashvars = "isshowrelatedvideo = falseshowad = 0show_pre = 1show_next = 1 isautoplay = falseisdebug = false Userid = wintype = interiorplaymovie = true & mm Control = falsemmout = falserecordcode = 1001,1002, 1003,1004, 1005,1006, 2001,3001, 3002,3003, 3004,3005, 3 9999, "pluginspage =" http://www.macromedia.com/go/getflashplayer" Width = "350" Height = "360"> </Embed>
If you can automatically determine whether a video address is input, the video address is called. In fact, this is relatively simple. The ykswf field can be perfectly implemented after a little processing: Collapse the XML/html code and copy the content to the clipboard. {Dede: field. ykswf Runphp = 'yes '} If (@ me = ''){ @ Me = '';} Else {@ me = '<embed Type = "application/X-Shockwave-flash" Src = "'. @ me .'" Id = "movie_player" Name = "movie_player" Bgcolor = "# ffffff" Quality = "high" Allowfullscreen = "true" Flashvars = "isshowrelatedvideo = falseshowad = 0show_pre = 1show_next = 1 isautoplay = falseisdebug = false Userid = wintype = interiorplaymovie = true & mm Control = falsemmout = falserecordcode = 1001,1002, 1003,1004, 1005,1006, 2001,3001, 3002,3003, 3004,3005, 3 9999, "pluginspage =" http://www.macromedia.com/go/getflashplayer" Width = "350" Height = "360" > </Embed> '; } {/Dede: field. ykswf}
An example is as follows: Now, all our processes have been completed. Let's take a look at the specific effect:
Ii. Tutorial Section 1) Considerations This tutorial is basically a friend who is familiar with the dedecms system. We suggest you follow the process described in this tutorial strictly when you come to practice. In this way, the final results can be successfully completed. I also hope that you will be able to get fish instead of fish in the tutorial. 2) code features The youku video introduced in this tutorial has the following features: The Youku page is not displayed in full screen; the logo icon of the Youku playback page is blocked; the Youku link is blocked; Basically, it is a perfect solution. |