This is the documentation for concrete5 version 5.6 and earlier. View Current Documentation

What we need

 //1. include Core and BlockType class (after namespace)
 use Core;
 use BlockType;

 //2. get the block
 $bt = BlockType::getByHandle('handle_of_the_block');
 $bPath = Core::make('helper/concrete/urls')->getBlockTypeAssetsURL($bt);

Example usage from within the block controller

namespace Application/Block/myBlock;

use Concrete\Core\Block\BlockController;
use BlockType;
use Core;

class Controller extends BlockController
{
    public function on_page_view()
    {
        $bt = BlockType::getByHandle('my_block');
        $bPath = Core::make('helper/concrete/urls')->getBlockTypeAssetsURL($bt);
    }
}
Loading Conversation