by
GrahamO » Thu Aug 13, 2015 7:47 am
Thanks KK,
I think I have found a better workaround as follows:
1. Add a separate image type to the repeatable template:
- Code: Select all
<cms:editable type='group' name='sec1' label='Section 1' order='3'/>
<cms:editable type='text' name='sec1Title' label='Title' group='sec1'/>
<cms:repeatable name='sec1Content' label='Section 1 Content' group="sec1">
<cms:editable type='text' name='subSec1Title' label='Subtitle'/>
<cms:editable type='nicedit' name='subSec1Content' label='Content'/>
<cms:editable type='image' name='subSec1Image' label='Image (optional)' show_preview='1' preview_width='120'/>
</cms:repeatable>
2. Place the img tag before the paragraph and float it with CSS:
- Code: Select all
<cms:show_repeatable 'sec1Content' >
<h4> <cms:show subSec1Title /></h4>
<img src="<cms:show subSec1Image />">
<p><cms:show subSec1Content /></p>
<hr>
</cms:show_repeatable>
3. Use an appropriately specific CSS attribute selector to hide the blanks when no image is used:
- Code: Select all
.panel img[src=""] {
display:none;
}
This allows images to be uploaded "into" the nicedit text block in a repeating region but manages the no image case. It seems to work with limited testing.