Galwyn Posted May 3, 2016 Share Posted May 3, 2016 Is there any way to put youtube video in product description? i've been searching forums but couldn't find any usefull information about it Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 3, 2016 Share Posted May 3, 2016 There is this:https://www.cubecart.com/extensions/plugins/display-youtube-videos Quote Link to comment Share on other sites More sharing options...
NARD Posted June 27, 2016 Share Posted June 27, 2016 On 5/3/2016 at 3:06 PM, bsmither said: There is this:https://www.cubecart.com/extensions/plugins/display-youtube-videos So, embedding videos through the editor (iframe) option no longer works? We now have to purchase an extension? This seems to be the case for me. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 27, 2016 Share Posted June 27, 2016 Creating an <iframe> in the product's description can be done, as there is a toolbar button (second row, far right, looks like a globe) to insert the <iframe>. The editor pops up a dialog box asking for the <iframe> details of the source document. That tells me the <iframe's> source document will have to be constructed by you, containing whatever code is necessary to launch the Youtube viewer. I would have to assume the plugin has completed all this prep work and all you need then is the video ID and to decide where to show the video. From the plugin product images, I see it can be placed in the Category, Product, and Document (including Homepage document) area. The plugin might be able to be modified to put a video other places, like the Registration page or, Checkout pages. Quote Link to comment Share on other sites More sharing options...
NARD Posted July 4, 2016 Share Posted July 4, 2016 On 6/27/2016 at 6:04 PM, bsmither said: Creating an <iframe> in the product's description can be done, as there is a toolbar button (second row, far right, looks like a globe) to insert the <iframe>. The editor pops up a dialog box asking for the <iframe> details of the source document. That tells me the <iframe's> source document will have to be constructed by you, containing whatever code is necessary to launch the Youtube viewer. I would have to assume the plugin has completed all this prep work and all you need then is the video ID and to decide where to show the video. From the plugin product images, I see it can be placed in the Category, Product, and Document (including Homepage document) area. The plugin might be able to be modified to put a video other places, like the Registration page or, Checkout pages. Thank you for your reply. Yes, that button you mentioned is the one was trying to use with the embed code from the Youtube video, which would not work for me. But I somply took that same mentioned above embed code and and inserted it in the source code for the product description and the video player was there on the front end. I should have thought of that in the first place. Thanks again, -Joe Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 13, 2017 Share Posted March 13, 2017 I've never tried this before, but I wanted to add the live feed of April the Giraffe to a Featured Giraffe Plush special category. Here's what Youtube shows as the embed code: <iframe width="560" height="315" src="https://www.youtube.com/embed/XQDbOJRNZx8" frameborder="0" allowfullscreen></iframe> I've tried adding it as-is in Source Code, but I get a blank page that says ./error.html up in the top left corner when I try to save. So I tried again using the Globe and putting the url and the size information from the embed info into the popup that comes up when I click the globe. I get the same dot slash error.html code. This is with 6.1.5 code. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 14, 2017 Share Posted March 14, 2017 I don't get that. The edited product description saved. I get the <iframe> when viewing the product. (I don't let things like this actually run, so I get a black box that says, "An error occurred. Watch this video on Youtube.") Create the error_log and maybe there is a clue. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 14, 2017 Share Posted March 14, 2017 Nothing shows up in the error log. Is there some smarty or javascript or ?? that might be missing that allows the IFrame to work? What I'm trying to do is embed the live feed video in the Category Description. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 14, 2017 Share Posted March 14, 2017 It saves in a product description without issue. But I can't get it to save in the Category description. Does that give you any idea what I have wrong? Or is this the reason SemperFi has the plugin - this won't work for every document box?? Trying to figure out a different approach to what I want - is there a way to specify code in content.category.php that will show only in category=173? I briefly tested adding the embed code straight into content.category.php, and it shows correctly - but of course it's at the top of EVERY category. Quote Link to comment Share on other sites More sharing options...
keat Posted March 14, 2017 Share Posted March 14, 2017 Hi Alex. Are you trying to add the feed to a category description. I had a little play with my test site, I can add the feed inside a product description, but not inside a category description I see Forbidden You don't have permission to access /adminxyz.php on this server. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request. I just watched my apache log and saw this.. It looks like mod security doesn't like it. Sort of explains why I can't embed it. [Tue Mar 14 15:34:17 2017] [error] [client xx.xx.xx.xxx] ModSecurity: Access denied with code 403 (phase 2). Pattern match "< {0,1}iframe" at ARGS:cat[cat_desc]. [file "/var/cpanel/cwaf/rules/07_XSS_XSS.conf"] [line "96"] [id "212280"] [rev "1"] [msg "COMODO WAF: Cross-site Scripting (XSS) Attack||www.domain.co.uk|F|2"] [data "Matched Data: <iframe found within ARGS:cat[cat_desc]: <p>this is a test category setup during install. it can be edited or deleted from the store admin control panel.</p> <p><iframe frameborder=\\x220\\x22 scrolling=\\x22no\\x22 src=\\x22http://www.domain.co.uk/test-category/test-product.html\\x22></iframe></p> "] [severity "CRITICAL"] [hostname "www.domain.co.uk"] [uri "/admin_xyz.php"] [unique_id "WMgNedWr3R8AACzCAC4AAAAM"] Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 14, 2017 Share Posted March 14, 2017 2 minutes ago, keat said: Are you trying to add the feed to a category description. Yes, that's what I wanted. But I don't mind hard coding the video code in content.category.php, as long as there is a way to limit it to that one category with some kind of if/then. There's something of an internet fad going on at the moment of people watching this giraffe on a live feed in the Animal Adventure Park in NY. She is very close to giving birth. There will be a naming contest after the calf is born. Since we have about 100 listings in our store for giraffes, I figured I'd try to market to those people as long as the craze lasts. Quote Link to comment Share on other sites More sharing options...
keat Posted March 14, 2017 Share Posted March 14, 2017 What about, taking a snapshop of the giraffe, adding this as an image to the category and then having this point to a hyperlink. http://www.sterlingworkshopsupplies.co.uk/test-category.html Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 14, 2017 Share Posted March 14, 2017 That would work, as I could easily link to the feed, but that takes them off our store. I don't want to do that. If it can't be done without buying the plugin for one limited purpose, I'll just do without the video. Quote Link to comment Share on other sites More sharing options...
keat Posted March 14, 2017 Share Posted March 14, 2017 I've been trying to see if I could get it to open in a seperate window/popup but struggling. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 14, 2017 Share Posted March 14, 2017 Don't spend any time on it, keat. I appreciate it, but it does just what I want if I hard code it. But I obviously would not want it on every category. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 14, 2017 Share Posted March 14, 2017 The difference between a product's description and a category description is only in the name of the key that is being POSTed: Product has "description" (and "description_short", but that's not important) Category has "cat[cat_desc]" Perhaps the mod_security has an exemption for a POST key of "description". Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 14, 2017 Share Posted March 14, 2017 What I have in mind, since the category description does not allow me to embed that way - is something like this concept: {if $cat_id=173} <br> <iframe width="560" height="315" src="https://www.youtube.com/embed/XQDbOJRNZx8" frameborder="0" allowfullscreen></iframe>{/if} <div id="ccScroll"> The if does not work, because I have no idea how to set the braces, quotation marks, parentheses, etc. So right now it shows up on every category when my code is there. But this is what it looks like on the Giraffe category (173) that I would like: Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 14, 2017 Share Posted March 14, 2017 (edited) Your statement will always resolve to true. But, you are using {$cat_id} when the correct variable is {$category.cat_id}. {if $category.cat_id eq 173}iframe stuff{/if} Smarty allows for the comparison operator eq in place of PHP's comparison operator ==. Your statement uses a single equals sign which is PHP's assignment operator. You are attempting to make $cat_id contain the value 173. The question is: will $cat_id acquire the value 173? The answer is: (probably) yes. (But that's not how Smarty works, so...Hm,?) Thus, this expression resolves to true. Edited March 14, 2017 by bsmither Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 14, 2017 Share Posted March 14, 2017 It works!! FANTASTIC! I had tried $category.cat_id at one time, but couldn't work out the right syntax. THANK YOU @bsmither!!! Now to work on the parameters that are keeping it from being responsive. I tried taking off the height and making the width 100%, but that didn't work. I ended up with {if $category.cat_id eq 173} <center> <iframe width="350" height="197" src="https://www.youtube.com/embed/XQDbOJRNZx8" frameborder="0" allowfullscreen></iframe> </center> {/if} <div id="ccScroll"> And you can see the result here: https://dirtybutter.com/plushcatalog/plush-giraffes.html Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 14, 2017 Share Posted March 14, 2017 AGHH! I may have celebrated too soon. I can't get it to play properly. Quote Link to comment Share on other sites More sharing options...
keat Posted March 15, 2017 Share Posted March 15, 2017 It looks Ok this morning. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 15, 2017 Share Posted March 15, 2017 I fiddled around with some of the parameters, and now it autoplays properly. THANKS! Quote Link to comment Share on other sites More sharing options...
harrisorganic Posted September 23, 2017 Share Posted September 23, 2017 (edited) DB, Seems you have taken the video down, as I can not see it. I am wanting to embed a video in the document file instead of the three pictures using bxslider. I used: <div class="flex-video"> <iframe width="500" height="213" src="https://www.youtube.com/embed/tioF5sFBBJg" allowfullscreen></iframe> </div> it works but it does not autoplay. Edited September 23, 2017 by harrisorganic Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted September 23, 2017 Share Posted September 23, 2017 Yes, it's down now. The zoo stopped streaming all the time. The code to get mine to autoplay was included in the embed code from them. Maybe it will work for you: <iframe width="350" height="197" src="https://www.youtube.com/embed/FyEtJgL552Y?ecver=1"rel=0&autoplay=1" frameborder="0" allowfullscreen></iframe> Quote Link to comment Share on other sites More sharing options...
harrisorganic Posted September 23, 2017 Share Posted September 23, 2017 Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.