Why are my blocks not showing in Page Types - Compose Form - Add Form Control?

Permalink
I'd like to add some blocks to a page type, but only 7 are showing when I have many more. They show on the left-side of the screen when I click +, but not in the Add Form Control panel.

Please see attached pic.

Any ideas?

Thanks

1 Attachment

View Replies:
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi PJSAndo,

The blocks in the Add Form Control menu have a composer.php file. I believe you point to your current block form or create a special form for use in Composer.

An example of adding blocks to the Composer form that I've seen:
- create a file called composer.php in the block folder
- add this code to composer.php
- "form.php" is the file name of the form your block is using, it may have a different name
<?php defined('C5_EXECUTE') or die("Access Denied.");
$this->inc('form.php', array('view' => $view));

- the Composer Control block needs to be placed in the page type output before the block form will be available in Composer

Not all blocks can be added this way. For example, blocks that use the Redactor editor need to use the new embedding method.
https://www.concrete5.org/documentation/developers/5.7/interface-cus...
$editor = Core::make('editor');
echo $editor-> outputBlockEditModeEditor('content', $content);
$editor = Core::make('editor');
echo $editor->outputStandardEditor('content', $content);
outputStandardEditor()
- does not have custom styles or concrete5 specific features
- includes all enabled plugins
outputBlockEditModeEditor()
- includes custom styles
- includes all enabled plugins
PJSAndo replied on at Permalink Reply
Thanks.

I created come custom blocks that do not have form.php. These are preset and don't have options so don't need a form.php. I just drag them on to a page and they pull in specific preset data.

What should I do in this case?
PJSAndo replied on at Permalink Reply
For blocks that don't have forms, I just put a blank composer.php file in the block's directory.
That seemed to work.

However, for some reason when I add new a block to a page type, pages that were created before the block was added do not update. Only pages created after the block has been added include the block.

Thought it might be an issue with caching but couldn't find anything.

Any ideas?
mhawke replied on at Permalink Reply
mhawke
You need to click on the new block (in Page Defaults) and choose 'Setup on Child Pages' to select which old pages receive this new block.
mhawke replied on at Permalink Reply
mhawke
@MrK...

I can't seem to find the "outputBlockEditModeEditor" function anywhere in the php code of 5.7.4. I tested it and I know it works but can't find the function. Any help?
MrKDilkington replied on at Permalink Reply
MrKDilkington
@mhawke

You can find the outputBlockEditModeEditor() method in this file.
https://github.com/concrete5/concrete5/blob/develop/web/concrete/src...

It has not been included in the documentation or the API page yet.
mhawke replied on at Permalink Reply
mhawke
Sorry, I need to search a newer version. Duh!