<div class="contentiframe">
    <iframe id="contentiframe" src="https://www.youtube.com/embed/4no-3jgS1Mo" onload="resizeIframe()" style="min-height:500px;"></iframe>
</div>
  • Content:
    /* @content-iframe */
    .contentiframe {
      text-align: center;
      iframe {
        width: 100%;
        height: auto;
        border: none;
        outline: none;
        max-width: 1150px;
        margin: 0 auto;
        overflow: hidden;
      }
    }
    
  • URL: /components/raw/contentiframe/_contentiframe.scss
  • Filesystem Path: src/components/cms-blocks/contentiframe/_contentiframe.scss
  • Size: 215 Bytes
  • Content:
    import $ from 'jQuery'
    
    function resizeIframe() {
    	if ($('#contentiframe').length) {
    		$('#contentiframe').css('height', $('#contentiframe').contents().height() + 'px');
    		console.log($('#contentiframe').contents().height());
    	}
    }
    
    $( document ).ready(function() {
      resizeIframe();
    });
    
  • URL: /components/raw/contentiframe/contentiframe.js
  • Filesystem Path: src/components/cms-blocks/contentiframe/contentiframe.js
  • Size: 287 Bytes
  • Content:
    <?php 
    $contentiframe = array (
      'key' => 'contentiframe',
      'label' => 'Content iFrame',
      'name' => 'contentiframe',
      'type' => 'repeater',
      'instructions' => '',
      'sub_fields' => array (
        array(
          'key' => 'contentiframe__url',
          'label' => 'Content iFrame URL',
          'name' => 'url',
          'type' => 'url',
          'instructions' => '',
          'required' => 1,
          'conditional_logic' => 0,
          'wrapper' => array(
            'width' => '',
            'class' => '',
            'id' => '',
          ),
          'default_value' => '',
          'placeholder' => '',
        ),
        array(
          'key' => 'hide_block',
          'label' => 'Hide this block from anchor links',
          'name' => 'hide_block',
          'type' => 'true_false',
          'instructions' => '',
          'required' => 0,
          'wrapper' => array(
            'width' => '',
            'class' => '',
            'id' => '',
          ),
          'message' => '',
          'default_value' => 0,
          'ui' => 1,
          'ui_on_text' => '',
          'ui_off_text' => '',
        ),
        array(
          'key' => 'contentiframe__minheight',
          'label' => 'Content iFrame Min Height',
          'name' => 'minheight',
          'type' => 'number',
          'instructions' => '',
          'required' => 1,
          'conditional_logic' => 0,
          'wrapper' => array(
            'width' => '',
            'class' => '',
            'id' => '',
          ),
          'default_value' => '',
          'placeholder' => '',
        ),
      ),
      'row_min' => 0,
      'row_limit' => '',
      'layout' => 'row',
    );
    
    array_push($_SESSION["blocks"], $contentiframe);
  • URL: /components/raw/contentiframe/contentiframe.php
  • Filesystem Path: src/components/cms-blocks/contentiframe/contentiframe.php
  • Size: 1.5 KB