Custom Block: Rick Text Editor in form.php (?)
Permalink
OK So my Question is pretty simple:
I want my Custom Block to able to implement the rich text editor while in Edit/Add mode.
I have my Custom Block already created in the **application/blocks/** directory.
Controller, db.xml, view all created and work as expected. My form.php looks like this:
Pretty Standard. I want my textarea to become the Rich Text Editor so all the view has to do is output the HTML to the page.
I cannot find in the documentation/ tutorials is a 5.7 way of adding the rich text editor the a custom block and what classes / helpers i need in order for it to work.
Is this possible? What am i missing? (also any critiques are welcome)
I want my Custom Block to able to implement the rich text editor while in Edit/Add mode.
I have my Custom Block already created in the **application/blocks/** directory.
Controller, db.xml, view all created and work as expected. My form.php looks like this:
<?php defined ('C5_EXECUTE') or die(_('Access Denied.')); $app = Concrete\Core\Support\Facade\Application::getFacadeApplication(); $form = $app->make('helper/form'); $tabs = $app->make('helper/concrete/ui'); // Create our menu tabs print $tabs->tabs(array( array('accordians', t('Accordians'), true) )); ?> <fieldset class="tab-content"> <div class="ccm-tab-content" id="ccm-tab-content-accordians"> <div class="form-group"> <?php echo $form->label('accordian_header' , t("Accordian Header")); ?> <?php print $form->text('accordian_header', $accordian_header); ?>
Viewing 15 lines of 21 lines. View entire code block.
Pretty Standard. I want my textarea to become the Rich Text Editor so all the view has to do is output the HTML to the page.
I cannot find in the documentation/ tutorials is a 5.7 way of adding the rich text editor the a custom block and what classes / helpers i need in order for it to work.
Is this possible? What am i missing? (also any critiques are welcome)
Ahhh this is exactly what i needed.
Code works perfectly, i used the Standard Editor for now since i don't expect to use more than some basic HTML & formatting but i'll keep the Block Editor just in case new use cases crop up.
Completely missed that documentation, noticed it was under "interface customization" - Big D'oh on my part, good eye.
Code works perfectly, i used the Standard Editor for now since i don't expect to use more than some basic HTML & formatting but i'll keep the Block Editor just in case new use cases crop up.
Completely missed that documentation, noticed it was under "interface customization" - Big D'oh on my part, good eye.
form.php:
controller.php:
There's also a simpler editor:
FYI:https://documentation.concrete5.org/developers/interface-customizati...