Table of contents
Package-Description
The Content Box package adds the Content Box block to your concreteCMS site. With the Content Box, you can easily insert rich text, an image from the file manager, and a link through the block form. You can choose a link to an internal page from the sitemap, a link to an internal file from the file-manager, or simply paste an external URL. You also have the option to leave the link field blank, in which case no button will appear on the page.
This package comes with two custom built-in block templates for the Content Box block. The block's design is fully responsive, ensuring it adapts to various screen sizes.
Upon installation, the package also creates a new page (single-page) in the CMS backend, where you can configure default settings for the Content Box.
Thanks to the straightforward handling of block data through the Content-Box Model and the block view (view.php), creating custom block templates is quick and very easy.
By minimizing unnecessary setting options in the block form, the Content Box is very user-friendly.
Simple handling of the block-data
It is very simple to work with the block-data. Down below an example.
// creating a ContentBox-Model using the current block-data.
/** @var \Concrete\Package\TgsContentBox\Block\TgsContentBox\Controller $blockController */
$relevantBlockData = $blockController->getBlockData();
/** @var \Concrete\Package\TgsContentBox\Model\ContentBox $cb */
$contentBox = app('tgs/contentbox/factory/contentbox')->createFrom($relevantBlockData);
echo $contentBox->getBlockId(); // int|null
echo $contentBox->getButtonType(); // string
echo $contentBox->getImageAlt(); // string
echo $contentBox->hasImage(); // bool
echo $contentBox->getLink(); // string