Code Snippet DM
Supports: Gutenberg, Elementor, TinyMCE and shortcode Display your code snippets in a stylish way inside your content. The plugin uses shortcodes and also very intuitive TinyMCE interface. Starting with v2.0.3, the plugin offers support to be used via a custom Elementor Widget. Starting with v2.0.1, the plugin offers support to be used via a custom Gutenberg block. It will continue to support the default way of adding the code snippet via shotcodes. Code Snippet DM was inspired by the Carbon project. We created a simple way to display your code snippets but also have control over the way it appears, thus making it more stylish. Also, on the front end in the top right you will find a Copy Code button that allows you to copy to clipboard the entired code snippet. The plugin provides you with a TinyMCE button that will allow you to display the code or an option to use a shortcode. You can open the shorcode [dm_code_snippet] and in the content inside and close it [/dm_code_snippet]. Elementor widget The Widget is called “Code Snippet DM” and can be found on the Basic list of Elementor Widget after you activate the plugin. Keywords that can be used to find it: code, snippet, dm. Once the widget is added in the Elementor editor, it can be customized via the sidebar settings that will appear for each widget. The sidebar will include all the settings that are available for the shortcode. Some of the settings will be applied in real time in your editor. The code styling (syntax highlight) and line numbers are only available on the front-end, in the editor you will not be able to preview the correct colors for the code or the line numbers. Gutenberg block The block is called “Code Snippet DM” and can be found in the embed section of Gutenberg blocks. Keywords that can be used to find it: code, snippet, dm. Once the block is added in the Gutenberg editor, it can be customized via the sidebar settings that will appear for each block. The sidebar will include all the settings that are available for the shortcode. Some of the settings will be applied in real time in your editor. The code styling (syntax highlight) and line numbers are only available on the front-end, in the editor you will not be able to preview the correct colors for the code or the line numbers. Shortcode Options There are a number of options that you can use in the shortcode: background with options yes or no will enable/disable the color background (Default yes) background-mobile with options yes or no will enable/disable the color background for mobile devices (Default yes) bg-color accepts any HEX, RGB or RGBA value to change the background color (Default #abb8c3) theme with options light or dark that changes the code editor theme (Default dark) slim with options yes or no that changes the code editor from default to a slim version, ideal for one-line code (Default no) line-numbers with options yes or no that will enable a left side line number for columns (Default no) language with options clike, css, javascript, markup, perl, php, python, ruby, sql, typescript, shell will highlight the syntaxes based on what you select for your code (Default php) wrap with options yes or no will wrap the code or add a horizontal scroll bar to display it as it is (Default no) height allows you to input any value and will set the code snippet height to that value. Example: 500px. (Default is empty) copy-text this is used for the text shown on the copy button. If it’s not added it will use the default option. (Default Copy Code) copy-confirmed this is used for the text shown after you click the copy button. If it’s not added it will use the default option. (Default Copied) Example of shortcode: [dm_code_snippet background="yes" background-mobile="yes" slim="no" line-numbers="no" bg-color="#abb8c3" theme="light" language="css" wrapped="no" height="500px" copy-text="Get the Code!" copy-confirmed="You have it!"] .dm-code-snippet.dark { background: $default-bg; padding: 40px 35px 45px 35px; margin: 30px 0; } [/dm_code_snippet] Important: * If you use the shortcode directly, make sure to wrap the code in as in the example above. * If you want to add HTML using the shortcode, you’ll need to escape the HTML before pasting it in the shortcode. (You can easily find an escape tool online to convert the code) * If you have code (not HTML) that uses ‘</’ and you add it with the shortcode and not the and the TinyMCE button, you will need to escape ‘</’ from your code in order to properly display it. Use the TinyMCE button if you don’t want to add the shortcode yourself. (see Screenshots)
Top keywords
- code31×3.85%
- default15×1.86%
- code snippet12×1.49%
- shortcode12×1.49%
- snippet12×1.49%
- dm9×1.12%
- options9×1.12%
- yes9×1.12%
- editor8×0.99%
- background6×0.74%
- button6×0.74%
- settings6×0.74%
YouList – YouTube playlist shortcode
This plugin adds the shortcode [youlist] so you can easily embed YouTube™ playlist defined by playlist id (PL in front of the playlist id) comma seperated video ids list user favorites user uploads search query in a single YouTube™ player. Live demo New in version 1.0.6 show random playlists with the new attribute ‘randompid’ added apply_filters for output, style, class and src bug fix New in version 1.0.5 enable nocookies enable the https protocol play videos in a specific quality (fx. hd720) enable wmode to handle z-index issues. Usage Examples To embed a playlist with thumbnails [youlist pid=”PL3FF15AA7ED356D9F”] To embed three videos with thumbnails (comma seperated video id list): [youlist vid=”ZF_K8D414-Y,sFHXWoawnt0,E2uOGOqIyC4″] To embed three videos without thumbnails: [youlist vid=”ZF_K8D414-Y,sFHXWoawnt0,E2uOGOqIyC4″ showinfo=”0″] To embed a playlist from the search string “higgs boson” [youlist search=”higgs boson” width=”600″ height=”400″] To embed a random playlist [youlist randompid=”PL3FF15AA7ED356D9F, PL9AEE7FF9E83DEA62, PL2B8DB1BD4364033F”] To embed a playlist for all uploaded videos for the user “mismag822″ [youlist uid=”mismag822″ listtype=”user_uploads”] To embed a playlist for all favorite videos for the user “mismag822″ [youlist uid=”mismag822″ listtype=”user_favorites”] To embed a playlist width your own custom style [youlist pid=”PL3FF15AA7ED356D9F” style=”width:300px;height:400px;z-index:1;”] To embed a user playlist with all the supported attributes (default values shown): [youlist uid=”mismag822″ randompid=”” showinfo=”1″ width=”680″ height=”480″ class=”youlist” autohide=”2″ autoplay=”0″ disablekb=”0″ listtype=”user_uploads” theme=”dark” modestbranding=”1″ controls=”1″ color=”red” fs=”1″ rel=”1″ start=”0″ loop=”0″ iv_load_policy=”1″ version=”3″ style=”” vq=”” nocookie=”0″ https=”0″ wmode=”” parameters=”” ] Ideas for how to use this plugin You can use it to display ad-video before or after the main video You can have your own short trailer before the main video You can collect lessons/tutorials/music videos You can use it for your YouTube™ playlist You can watch your friends favourites videos You can collect videos for your kid and watch it on your site … etc … Shortcode Parameters The youList-shortcode is a wrapper for most of the YouTube™ iframe parameters described here: https://developers.google.com/youtube/player_parameters iframe parameters: width [integer] – iframe width in pixels height [integer] – iframe height in pixels class [string] – iframe css classname style [string] – iframe css custom style parameters [string] – custom source parameters (¶m1=value1&…) youtube parameters: pid [string] – YouTube playlist ID uid [string] – YouTube user ID) vid [string] – Comma seperated YouTube Videos ID list randompid [string] – YouTube random playlist ID, from a comma seperated PID’s list listtype [playlist|user_uploads|search] – YouTube listtype search [string] – YouTube search string) theme [dark|light] – Dark or light control bar modestbranding [0|1] – Prevent the YouTube logo from displaying in the control bar showinfo [0|1] – Display thumbnail images for the videos in the playlist autohide [0|1|2] – Hide the video controls automatically after a video begins playing autoplay [0|1] – The initial video will autoplay when the player loads disablekb [0|1] – Disable the player keyboard controls controls [0|1|2] – Display the video player controls color [red|white] – The color in the video progress bar fs [0|1] – Display the fullscreen button rel [0|1] – Show related videos when playback of the initial video ends start [integer] – Play the video at the given number of seconds from the start of the video loop [0|1] – Play the entire playlist and then start again at the first video iv_load_policy [1|3] – Show video annotations version [2|3] – AS player version https [0|1] – Enable the https protocol nocookie [0|1] – No cookies thank you vq [small|medium|large|hd720|hd1080] – Change video quality