Hi all,
I'm trying embed a youtube video to only one information page in Opencart 3.0.2.0
I want the video to adjust to the width of the page so I've
added this to the stylesheet.css file:
.container1 {
position: relative;
width: 100%;
height: 0;
padding-bottom: 56.25%;
}
.video1 {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
After that, I updated the information.twig file with:
(Note: That's just an example video.)
<div class="container1">
<iframe src="https://www.youtube.com/embed/1RAwXtVr0U4?" frameborder="0" allowfullscreen class="video1"></iframe>
</div>
Video adjusts perfectly.
Problem is that it's showing on every information.twig page.
I've been fiddling with if statements with no luck.
I'm new to this and can't figure it out.
It's frustrating because, I'm guessing this is very easy.
I read something about updating a variable with the current page on the controller file.
Then doing an if statement on the information.twig file.
Don't know what a controller file is.
Any help here would be so great..
Thank you..
if your trying to add a video to a information page then you can do this within the cpanel just go to catalog > information > Your Page > then you select the video bbcode and put link in,AD02143 wrote: ↑Mon Feb 12, 2018 6:25 amHi all,
I'm trying embed a youtube video to only one information page in Opencart 3.0.2.0
I want the video to adjust to the width of the page so I've
added this to the stylesheet.css file:
.container1 {
position: relative;
width: 100%;
height: 0;
padding-bottom: 56.25%;
}
.video1 {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
After that, I updated the information.twig file with:
(Note: That's just an example video.)
<div class="container1">
<iframe src="https://www.youtube.com/embed/1RAwXtVr0U4?" frameborder="0" allowfullscreen class="video1"></iframe>
</div>
Video adjusts perfectly.
Problem is that it's showing on every information.twig page.
I've been fiddling with if statements with no luck.
I'm new to this and can't figure it out.
It's frustrating because, I'm guessing this is very easy.
I read something about updating a variable with the current page on the controller file.
Then doing an if statement on the information.twig file.
Don't know what a controller file is.
Any help here would be so great..
Thank you..
http://prntscr.com/ide2nx
Thank You Ashon,
Yes, but as I wrote in my post, I'm not only trying to add a video.
"I want the video to adjust to the width of the page".
That's why I updated the css file as I did and updated the information.twig file.
I don't believe your suggestion meets those needs...
Yes, but as I wrote in my post, I'm not only trying to add a video.
"I want the video to adjust to the width of the page".
That's why I updated the css file as I did and updated the information.twig file.
I don't believe your suggestion meets those needs...
Goto Catalog - Information
Edit the information page
Click </> Codeview
Paste:
Note: Replace ZDhnVPB8ev0 by embed code from movie you want to embed.
Edit the information page
Click </> Codeview
Paste:
Code: Select all
<div class="col-xs-12 embed-responsive embed-responsive-16by9">
<iframe frameborder="0" src="//www.youtube.com/embed/ZDhnVPB8ev0?autoplay=1&loop=1&playlist=ZDhnVPB8ev0&showinfo=0&theme=light&color=white&controls=0&modestbranding=1&start=1&fs=0&iv_load_policy=3&wmode=transparent&rel=0"></iframe></div>
If you are looking for specific needs, that can be done as a custom job, simply create a new topic in the Commercial Support section of the forum.I don't believe your suggestion meets those needs...
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Thank You straightlight.. I'll do that now.
Thanks for your reply pprmkr.
However, copying that code into the information page comes up blank once you save.
I wish that it didn't because that seems like it would be the solution.
Do you have any idea why it can't be saved?
Thanks for your reply pprmkr.
However, copying that code into the information page comes up blank once you save.
I wish that it didn't because that seems like it would be the solution.
Do you have any idea why it can't be saved?
Who is online
Users browsing this forum: NicNie and 224 guests