ECB2 Repeatable Blocks Assigning Different CSS Styles To TextArea
Posted: Tue Apr 29, 2025 11:37 am
CMSMS 2.2.21
AceEditor2 1.05
Captcha 1.0
CMSMSExt1.0.1
ECB2 2.4
Gallery 2.4.2
SitemapMgr 1.6
SmartImage 1.0
SmartyExt 1.0
I am looking to have several repeatable textarea blocks on the same page, what I'd really love to do is to be able to assign a different background colour to the containing div of that textarea repeatable block. I have had a really good look through the forums and have also asked ChatGPT (which was useless of course).
My current code:
The output I'd like to achieve...
As you can see I'd like to be able to add a choosable style after the initial "repeatable-block" style, this will enable me to have alternating colours for the repeatable-block div going down the webpage for interest.
I can't see any way currently of being able to add a choosable style extra to the field="textarea".
AceEditor2 1.05
Captcha 1.0
CMSMSExt1.0.1
ECB2 2.4
Gallery 2.4.2
SitemapMgr 1.6
SmartImage 1.0
SmartyExt 1.0
I am looking to have several repeatable textarea blocks on the same page, what I'd really love to do is to be able to assign a different background colour to the containing div of that textarea repeatable block. I have had a really good look through the forums and have also asked ChatGPT (which was useless of course).
My current code:
Code: Select all
{content_module module="ECB2" field="textarea" label='Textarea' block="Repeatable_Content" repeater="1" wysiwyg="1" assign="Repeatable_Content" description="This is an editable area you can create multiple fields of to allow you to have text and images in the same box"}
{foreach from=$Repeatable_Content item=row}
<div class="repeatable-block">
{$row}
</div>
{/foreach}
Code: Select all
<div class="repeatable-block {insert choosable css style here}">
<p><img style="float: left;" src="uploads/PageImages/image-here.jpg" alt="image-here" width="188" height="289" />Here is some exciting text.</p>
<p>Here is some exciting text.</p>
<p>Here is some exciting text.</p>
<hr /></div>
I can't see any way currently of being able to add a choosable style extra to the field="textarea".