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:
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
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
This forum post also provides a lot of answers:
http://www.concrete5.org/community/forums/customizing_c5/contributi...
http://www.concrete5.org/community/forums/customizing_c5/contributi...
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
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 } ?>
Thanks Katz, I may add that as an extra block template on the next version. Nice work :-)
You might also be interested in:
http://www.concrete5.org/marketplace/addons/youtube-pro/...