youtube block templates

Permalink
Hi,

in this folder is the view.php
/concrete/blocks/youtube/view.php
with the block size:
Width=425
Height=344

and now, if I want to customize the youtube block size, I copy to
/blocks/youtube/view.php
and customize the size I want like the example below
Width=200
Height=200

Now to the problem I have:
If I make this for me on my server, I do it the way you see above and it is very quick. But how to I integrate the customized view.php into the theme package.

I have done it this way:
BlockType::installBlockTypeFromPackage('a_youtube', $pkg);

I have integrated the new a_youtube block per controller, but as it seams, it's also not the correct way. Both ways above are working without problem.
Is there any other way, to make it the correct way for an installable theme package?
I have read the how-to all, but could not find the right way.
I would be glad for any help.

THX

 
jb1 replied on at Permalink Reply
jb1
You need to put your modified view.php file into a "templates" folder at the same level. You can rename that file to anything you wish. Then upload the folder and contents to your server. It will now be available as a "custom template" when clicking the block in edit mode.

You might also be interested in:
http://www.concrete5.org/marketplace/addons/youtube-pro/...
jb1 replied on at Permalink Reply
jb1
This forum post also provides a lot of answers:
http://www.concrete5.org/community/forums/customizing_c5/contributi...
katz515 replied on at Permalink Reply
katz515
BTW, I just modified view.php to convert to iFrame method

As you may know, YouTube now recommend to use iFrame tag instead of object tag.

Modify the values of $vWidth and $vHeight according to your preferences

<?php 
defined('C5_EXECUTE') or die("Access Denied.");
$url = parse_url($videoURL);
parse_str($url['query'], $query);
$c = Page::getCurrentPage();
$vWidth=640; // Video Width
$vHeight=390; // Video Height
if ($c->isEditMode()) { ?>
   <div class="ccm-edit-mode-disabled-item" style="width:<?php  echo $vWidth; ?>px; height:<?php  echo $vHeight; ?>px;">
      <div style="padding:8px 0px; padding-top: <?php  echo round($vHeight/2)-10; ?>px;"><?php  echo t('Content disabled in edit mode.'); ?></div>
   </div>
<?php  } else { ?>   
   <iframe width="<?php echo $vWidth;?>" height="<?php echo $vHeight;?>" src="http://www.youtube.com/embed/<?php echo $query['v']?>" frameborder="0" allowfullscreen></iframe>
<?php  } ?>
jb1 replied on at Permalink Reply
jb1
Thanks Katz, I may add that as an extra block template on the next version. Nice work :-)