Sylvio Posted April 6, 2011 Share Posted April 6, 2011 So I am building a complex website for a client and so far everything that seemed to be difficult at first to implement was a breeze with PW, the flexibility of the system is amazing. There is one thing I am not sure to implement in a proper way. How can I make it easy for this client to link/embed videos, from youtube, vimeo, etc... or his own uploaded movie? Any ideas on how to deal with this? Link to comment Share on other sites More sharing options...
ryan Posted April 6, 2011 Share Posted April 6, 2011 Embedded videos are easy: just create a textarea field and don't add any textformatters to it. Then the client simply pastes in the YouTube/vimeo/etc. provided embed code into that field on the page. All you have to do is output it in your template. For client uploaded videos (non embedded) you just create a regular file field. Your means of output in your template will depend on the video format and what you do with it. I usually advise clients to use an embedding service because it makes it so darn easy, and bulletproof. If you don't want YouTube/etc branded videos, there are some very good an inexpensive commercial video embed services that work the same way but tailored to you (I think screencast.com is one). However a regular file upload field in PW will be just as easy if you know the details of your video format and targeted player. Link to comment Share on other sites More sharing options...
Sylvio Posted April 6, 2011 Author Share Posted April 6, 2011 I am also pro embedding services, my first thought was also the use of a textarea field, the problem is, I don't know how many videos on a page can be added, the client can add one or more... But I don't want to give them let's say 5 visible empty textareas from the start, but the ability to add another textarea for video if they want to. For images and file upload fields it's easy, they are more flexible in PW. Link to comment Share on other sites More sharing options...
ryan Posted April 6, 2011 Share Posted April 6, 2011 A single textarea should be able to accommodate multiple embeds (at least, that's what I do). But if you want to keep them separate (which woud probably be more bulletproof for client use), setup a separate child page for each embed. Then your video page would just cycle through it's children to pull as many video embeds as it needs. To make it even more bulletproof for the client, make a separate video_embed template and set it to be the predefined template that is used when adding children to your video page (under Setup > Templates > Your Template > Advanced). Link to comment Share on other sites More sharing options...
Adam Kiss Posted April 6, 2011 Share Posted April 6, 2011 I hate to repeat myself, but this, once again, is a good case for the matrix mentioned in the post that someone posted the other day. Simple repeated, self-expanded (user adds one 'group' of fields, another empty is added – the same way file/image field behaves) is a must in various cases. Even if it wasn't that ellegant as menton p&t matrix, at least some include of repeatable partial template or something. There is just that need to have some repeated elements in the same page (as opposed to setting up children pages), not mentioning cases where children need to be used for real pages, rather than repeated meta-data (except this can be easily solved via hidden branch 'meta-data' in your tree) Link to comment Share on other sites More sharing options...
GGSuper3 Posted September 30, 2011 Share Posted September 30, 2011 Hi all, I am presently building a website to include video. I placed in the textarea field recommended by Ryan but do not know specifically what code to place into template to render on page on my home server. I am referring to what Ryan posted- 'Embedded videos are easy: just create a textarea field and don't add any textformatters to it. Then the client simply pastes in the YouTube/vimeo/etc. provided embed code into that field on the page. All you have to do is output it in your template.' Also I am doing something similar with PayPal into site. I am using FatFreeCart for embedding into pages and set up a field as above for it also but do not know what code to insert into template. I am presently using it at www.shanaleegibson.ca (this is the website I am now building new in ProcessWire) Any suggestions or help would be greatly appreciated! Cheers, Grant Link to comment Share on other sites More sharing options...
apeisa Posted September 30, 2011 Share Posted September 30, 2011 If your textarea field is called "youtube", then it is simply this on your template file: echo $page->youtube; And this is example code that your client updates to that field: <iframe width="560" height="315" src="https://www.youtube.com/embed/XKnG7sikE-U" frameborder="0" allowfullscreen></iframe> Link to comment Share on other sites More sharing options...
GGSuper3 Posted September 30, 2011 Share Posted September 30, 2011 Thanks for a prompt response APEISA, I should have been a little more clear in my first post. I placed echo $page->youtube; in the template. Also my code for YouTube is in the correct field. I'll work on it and see if I can figure this out. Will update. Thanks for your help. Link to comment Share on other sites More sharing options...
apeisa Posted September 30, 2011 Share Posted September 30, 2011 No worries and welcome to the forums. If you don't get it working, just paste your template code here and I am sure we can figure it out. Link to comment Share on other sites More sharing options...
GGSuper3 Posted October 1, 2011 Share Posted October 1, 2011 I discovered the problem and solution to video and paypal output. In the textareas field I placed the name with a capital, Video vs. video and Paypal vs. paypal. It resolved and works perfect. Ah...the little things they can get ya stumped...I also got GMAP working on my site. Hope to upload to public server soon and will let PW community know when done. I appreciate the support here in the forum. It makes learning a new CMS framework fun! Link to comment Share on other sites More sharing options...
ryan Posted October 3, 2011 Share Posted October 3, 2011 Thanks for posting and glad that you are enjoying ProcessWire and the forum. I look forward to your new site! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now