Open add-on direct instead of add block menu?
Permalink
is it possible to open an add-on direct instead of the add block menu?
something like this?
<?php
$a = new Area('Youtube');
$a->display($c[youtube video]); <--- the add-on's name?
?>
something like this?
<?php
$a = new Area('Youtube');
$a->display($c[youtube video]); <--- the add-on's name?
?>
thank you.
I will try that and give feed back on it.
I will mark your answer as best if it works :)
I will try that and give feed back on it.
I will mark your answer as best if it works :)
can you help me with this code?
so if i get it right it should open the edit menu?
but the button wont show
so if i get it right it should open the edit menu?
but the button wont show
any?
Hi,
If you use this solution, you should use the __Scrapbook Block Name__ as the block identifier:
And you should add a new "Recent Tweets" Block to your Scrapbook. Just go to Dashboard => Scrapbook => Global => "Add Block to Scrapbook"
After adding it, just rename it to ScrapbookBlockName (or whatever you want to use) by clicking the newly created block's name.
This way it should pull the block from scrapbook.
Antti / Mainio
If you use this solution, you should use the __Scrapbook Block Name__ as the block identifier:
$b = Block::getByName('ScrapbookBlockName'); // <--- Scarpbook Block Name $bv = new BlockView(); echo $bv->render($b, 'view'); // <-- the view name for your block, e.g. if you want to use custom template use 'templates/my_template'
And you should add a new "Recent Tweets" Block to your Scrapbook. Just go to Dashboard => Scrapbook => Global => "Add Block to Scrapbook"
After adding it, just rename it to ScrapbookBlockName (or whatever you want to use) by clicking the newly created block's name.
This way it should pull the block from scrapbook.
Antti / Mainio
what i want to do is when you normaly open up the "add block menu" i will skip that and add a pre selected block, så i still get the edit menu so i can fill in that :)
Ok, not getting at all what you want.
Maybe a screenshot/mockup of what you're trying to accomplish would help...? Or someone who understands better.
Antti
Maybe a screenshot/mockup of what you're trying to accomplish would help...? Or someone who understands better.
Antti
Ok, that requires you to override some JS, it's quite a biggie and requires quite good knowledge of JavaScript.
For a free advice I can give you that you need to override this function:
You can find that functions original version from /concrete/js/ccm.ui.js.
In the code is commented what you need to do.
Antti / Mainio
For a free advice I can give you that you need to override this function:
var _ccm_showAreaMenu = ccm_showAreaMenu; ccm_showAreaMenu = function(obj, e) { var yourOverrideCondition = false; // TODO: Your override condition checking here if (yourOverrideCondition) { // TODO: Your override here } else { // If not override, call the original function _ccm_showAreaMenu(); } }
You can find that functions original version from /concrete/js/ccm.ui.js.
In the code is commented what you need to do.
Antti / Mainio
thank you i tried to find that, in the php files the hole day, but did'nt knew i should look in the js
You can put the block in the scrapbook and code that in the theme, that always works:
[code}
<?php
$block = Block::getByName('BLOCK NAME');
if( is_object($block) ) $block->display();
?>
(www.weblicating.com/c5/cheat-sheet/)
[/code]