Tagged: GDPR, video, video element
-
AuthorPosts
-
March 8, 2022 at 6:06 pm #1343711
I inspected the Video Element and am wondering if it would be possible to set the option “confirm_all” as standard? The “aviaTBconditional_play” has 3 values and I would like for every Video Element to use “confirm_all” as preselected choice. Any ideas?
March 9, 2022 at 6:21 am #1343771Hey spooniverse,
Thank you for the inquiry.
Are you referring to the Lazy Load videos settings? You have to modify the video.php file or shortcode template and edit this option around line 344.
$c = array( array( 'name' => __( 'Lazy Load videos', 'avia_framework' ), 'desc' => __( 'Option to only load the preview image. The actual video will only be fetched once the user clicks on the image (Waiting for user interaction speeds up the inital pageload).', 'avia_framework' ), 'id' => 'conditional_play', 'type' => 'select', 'std' => '', 'lockable' => true, 'subtype' => array( __( 'Always load videos', 'avia_framework' ) => '', __( 'Wait for user interaction to load the video', 'avia_framework' ) => 'confirm_all', __( 'Show in lightbox - loads after user interaction - preview image recommended', 'avia_framework' ) => 'lightbox' ), ) );
Set the “std” parameter to “confirm_all”.
$c = array( array( 'name' => __( 'Lazy Load videos', 'avia_framework' ), 'desc' => __( 'Option to only load the preview image. The actual video will only be fetched once the user clicks on the image (Waiting for user interaction speeds up the inital pageload).', 'avia_framework' ), 'id' => 'conditional_play', 'type' => 'select', 'std' => 'confirm_all', 'lockable' => true, 'subtype' => array( __( 'Always load videos', 'avia_framework' ) => '', __( 'Wait for user interaction to load the video', 'avia_framework' ) => 'confirm_all', __( 'Show in lightbox - loads after user interaction - preview image recommended', 'avia_framework' ) => 'lightbox' ), ) );
Best regards,
IsmaelMarch 15, 2022 at 9:55 am #1344495That works as expected. Thanks a lot!
March 15, 2022 at 9:56 am #1344496What do I have to do if there are changes in video.php in parent theme (with an update of Enfold)?
March 15, 2022 at 1:21 pm #1344560Hi,
You will have to update it again if you did the modification directly in the parent theme. To preserve the modification or the changes in that file, you can override the shortcode file in the child theme directory. Please check this documentation for more info.
// https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb
You need to use the filter provided in the documentation, create a folder called “shortcodes” in the child theme directory and create a copy of the shortcode file. You can then do the modification in the copied file.
Best regards,
IsmaelMarch 15, 2022 at 2:40 pm #1344570I understand that and did it like that. But what happens if you have new code in video.php? The filter loads my child theme version of the file so your possible additions or changes can’t come through, or am I wrong?
March 15, 2022 at 7:46 pm #1344649The snippet from Ismael’s link placed in your child-theme functions.php ensures that only the child theme is loaded exclusively.
if you only have changes in the php – it is not necessary to have css and js child-theme files.
If you edit them too – you can change the loading in the child-theme php file . f.e. in video.php at lines 43ff:function extra_assets() { //load css wp_enqueue_style( 'avia-module-video', AviaBuilder::$path['pluginUrlRoot'] . 'avia-shortcodes/video/video.css', array( 'avia-layout' ), false ); wp_enqueue_script( 'avia-module-slideshow-video', AviaBuilder::$path['pluginUrlRoot'] . 'avia-shortcodes/slideshow/slideshow-video.js', array( 'avia-shortcodes' ), false, true ); wp_enqueue_script( 'avia-module-video', AviaBuilder::$path['pluginUrlRoot'] . 'avia-shortcodes/video/video.js', array( 'avia-shortcodes' ), false, true ); }
f.e. by replacing the load css file via:
//load css wp_enqueue_style( 'avia-module-video', get_stylesheet_directory_uri().'/shortcodes/menu.css', array( 'avia-layout' ), false );
and then you will upload that edited css file to the shortcodes folder aswell.
March 16, 2022 at 8:58 am #1344690Hi,
But what happens if you have new code in video.php? or am I wrong?
You are actually correct. But please note that we do not constantly change every files in the theme on each update or patch, so you will only have to update the override or the modified file if there are changes in the original shortcodes files or if there are issues with the modified elements. You can check these updates in the change log.
Best regards,
IsmaelMarch 16, 2022 at 10:14 am #1344705Hi Ismael, thank you for the clarification. In case of changing a shortcode file with a theme update, is there a corresponding note in the changelog?
March 16, 2022 at 10:26 am #1344707@Guenni007: Danke für deine wiederholte Hilfe hier im Forum! Das mit dem Einbinden habe ich verstanden, hattest du mir auch für den Sticky Header an anderer Stelle erläutert, sehr hilfreich! Du warst ja auch im Thread zum Sticky Menü aktiv, dort habe ich deine Lösung nachgebaut und bis jetzt immer noch nicht verstanden, warum bei mir in der speziellen Installation bzw. Konstellation der normale Code zum Überschreiben von Shortcode-Files nicht funktioniert. In der entsprechenden functions.php habe ich diese beiden Codes (von dir übernommen) drin, die jeweils Theme-Bestandteile aus anderen Ordnern laden lassen:
add_action( 'wp_enqueue_scripts', 'wp_change_sticky_header_script', 100 ); function wp_change_sticky_header_script() { wp_deregister_script( 'avia-sticky-header' ); wp_enqueue_script( 'avia-sticky-header-child', get_stylesheet_directory_uri().'/js/avia-snippet-sticky-header.js', array('avia-default'), $vn, true); }
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
Den zweiten musste ich jedoch anpassen, damit die 3 Menü-Dateien richtig geladen werden:
add_filter('ava_builder_shortcode_files_loaded', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths){ $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
Wenn ich den normalen Code aus der Dokumentation nehme zerschießt es immer das korrekte Styling. Sobald auf einer Seite ein Sticky Menü ist wird alles oberhalb des Menüs noch richtig dargestellt, alles darunter lädt das korrekte CSS nicht mehr. Ismael sagte mir bereits, dass mein Code zum Überschreiben des Verzeichnis nicht richtig sei, er funktioniert jedoch nur so (dann sieht auch alles richtig aus), wenn ich den originalen Code verwende klappt es wie gesagt bei mir nicht wie bei dir …
Hältst du es für möglich, dass das am Zusammenspiel der beiden Codes für Sticky Header und Sticky Menü liegt? Es wird ja einmal auf /js und einmal auf /shortcodes verwiesen. Die 1 Datei für den Header liegt in /js, die 3 Dateien fürs Menü liegen direkt in /shortcodes (kein weiterer Unterordner, oder ist das das Problem?). Hab schon versucht beides in einen Ordner zu legen, hat aber auch nicht wirklich geklappt.
Ist vermutlich aus der Ferne schwer zu beurteilen, dachte aber ich frag dich mal.
Viele Grüße, Daniel
March 21, 2022 at 8:29 am #1345320Hi,
is there a corresponding note in the changelog?
There will be no specific list of files but there will be a note about fixes and new features which should give you a hint or idea when there are changes in certain theme files.
Best regards,
IsmaelApril 7, 2022 at 5:22 pm #1347601Hey Ismael, my question is answered, you may close this. Cheers, Daniel
April 8, 2022 at 3:52 am #1347650Hi,
Glad Ismael could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Standard Setting for Video Element’ is closed to new replies.