Products modules auto ignore video tag Topic is solved
-
- Forum Members
- Posts: 17
- Joined: Sat Aug 17, 2013 4:49 am
Products modules auto ignore video tag
I have a problem with Products module
When i write to Details field of Item products, every html tags working ok but video tags like: iframe, video, embed are ignored. After i click save they're disappeared. May be Products module auto ignore video tags.
How to insert youtube video to Details fied of Products module? Thank you very much!
When i write to Details field of Item products, every html tags working ok but video tags like: iframe, video, embed are ignored. After i click save they're disappeared. May be Products module auto ignore video tags.
How to insert youtube video to Details fied of Products module? Thank you very much!
Re: Products modules auto ignore video tag
What about adding a custom field for the Youtube video ID and creating the needed html (iframe, embed, video) in the detail template.
You can make it conditionally (so only if the field has a value).
Think that would have multiple benefits. Like you can change that templated html-code in the future.
You can make it conditionally (so only if the field has a value).
Think that would have multiple benefits. Like you can change that templated html-code in the future.
-
- Forum Members
- Posts: 17
- Joined: Sat Aug 17, 2013 4:49 am
Re: Products modules auto ignore video tag
Thank you for your help Velden! Your method i've already used, but it's not flexible because the video is inserted at fixed position in detail tempalte, before or after {$entry->details}. I'm looking for method to insert video tags without ignore of Products module.
Re: Products modules auto ignore video tag
I think I should have started with a warning: the Products module is abandoned bij it's developer. Consider this if starting with this module.
Flexibility could be added by using two 'details' fields; one before an optional video and one after.
Another option would be to create a UDT (user-defined tag) which provides an editor with a simple method to insert a Youtube video.
E.g.
or
I stand by the fact that I think you should be able to change the video code when for example YouTube decides it should be completely different. You then don't want to change it in 1000 product details.
BTW: are you sure this behavior is Products-module specific? Or is it the wysiwyg editor doing it? What happens when you add such code to a normal page for example?
Flexibility could be added by using two 'details' fields; one before an optional video and one after.
Another option would be to create a UDT (user-defined tag) which provides an editor with a simple method to insert a Youtube video.
E.g.
Code: Select all
blabla {Youtube id=mCXQ6vJ1Enw} blabla
Code: Select all
blabla {Youtube url=https://youtu.be/mCXQ6vJ1Enw} blabla
BTW: are you sure this behavior is Products-module specific? Or is it the wysiwyg editor doing it? What happens when you add such code to a normal page for example?
Re: Products modules auto ignore video tag
Have you tried eval..?
Re: Products modules auto ignore video tag
Eval shouldn't be of any help in this case. That's for Smarty, not for disappearing html.
Re: Products modules auto ignore video tag
The WYSIWYG will strip out tags, but depending on which one you're using you may be able to add specific tags to the whitelist. Velden's idea of a plugin or UDT is probably a better one though.
Not getting the answer you need? CMSMS support options
-
- Forum Members
- Posts: 17
- Joined: Sat Aug 17, 2013 4:49 am
Re: Products modules auto ignore video tag
Thanks for your help Velden and Dr.CSS and DIGI3!
I think this behavior is Products-module specific because when i turn off Micro Tiny (Select WYSIWYG to use to none), the video tags are still removed. Another pages video tags working ok.
In my case, i have about 1000 products. With each product i have 0, 1,2 or more videos to describe it and they can be inserted anywhere in product details.
I am currently using the method create there Fields youtube1, youtube2, youtube3 and make it conditionally to be appear
I'm not a coder so there something i don't understand, i make website for my own not for another to use. More than 10 years a go, i've choice cmsms because the text "made simple". And now, i still feel happy with that choice !
I think this behavior is Products-module specific because when i turn off Micro Tiny (Select WYSIWYG to use to none), the video tags are still removed. Another pages video tags working ok.
In my case, i have about 1000 products. With each product i have 0, 1,2 or more videos to describe it and they can be inserted anywhere in product details.
I am currently using the method create there Fields youtube1, youtube2, youtube3 and make it conditionally to be appear
I'm not a coder so there something i don't understand, i make website for my own not for another to use. More than 10 years a go, i've choice cmsms because the text "made simple". And now, i still feel happy with that choice !
Re: Products modules auto ignore video tag
I followed that approach to lazy load YouTube videos (due to cookie law and GDPR).
Using the following JavaScript that does the HTML formatting: https://github.com/creopard/lazy-load-youtube-videos
and a new UDT like
Code: Select all
{youtube_link_lazy id='bDuXLQjaocE'}
Code: Select all
$id = isset($params['id']) ? $params['id'] : '';
if ( !empty($id) ) {
echo '<div class="wrapper"><div class="llyv" data-id="'.$id.'"></div></div>';
}
-
- Forum Members
- Posts: 17
- Joined: Sat Aug 17, 2013 4:49 am
Re: Products modules auto ignore video tag
I've found solution. I add a textarea field (custom field), and textarea field don't trip out video tag. It's so simple I didn't think. Thank you very much!