Problems, need help? Have a tip or advice? Post it here.
15 posts Page 1 of 2
Is there any way to upload an image into nicedit? All I can see is a URL option but that adds a layer of complexity that I don't want to pass onto the customer.

Thanks

BTW the nicedit tag is missing from both editable type listings on this page.....
Graham
Nicedit was introduced only for simple text entry within 'repeatable-regions' (as we cannot use 'richtext' within those).
It is pretty rudimentary and if you want to put images within it, I'm afraid, the popup you saw is all that it provides.

However, you can try providing an 'image' region (outside of the repeatable regions) just for the purpose of accessing the filemanager. The client can upload/select images from there and then copy/paste the URL into nicedit.

Will that help?
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.
Graham
You can use Couch's if tag to output that image only if it exists, saving yourself the CSS shenanigans.
Code: Select all
                    <cms:show_repeatable 'sec1Content' >
                    <h4> <cms:show subSec1Title /></h4>

                    <cms:if subSec1Image>
                        <img src="<cms:show subSec1Image />">
                    </cms:if>

                    <p><cms:show subSec1Content /></p>
                    <hr>
                    </cms:show_repeatable>
That oversight in the docs was noted previously and fixed in the new version - http://docs.couchcms.com/.
Thanks Tim,
That is a much cleaner solution. Not sure how I missed that one because I did look for some form of Couch logic control.

tim wrote: You can use Couch's if tag to output that image only if it exists, saving yourself the CSS shenanigans.
Graham
:!: True Cheesypoof,
BUT, unfortunately, the 'Documentation' link from the Couch home page still goes to 'http://www.couchcms.com/docs/' not to 'http://docs.couchcms.com/' and the problem page (perhaps along with other unfixed docs) is still the default accessible version so there may be a little link housekeeping and page removal still needed. Nothing is simple is it? Except perhaps CouchCMS - loving it......

cheesypoof wrote: That oversight in the docs was noted previously and fixed in the new version - http://docs.couchcms.com/.
Graham
Graham, we are in the process of moving the docs to the new location.
It should be complete in a day or so.
Excellent,
I'm definitely not trying to bug you - I just want to communicate potential issues - bit quick on the trigger this time......
Graham
I just want to communicate potential issues
We appreciate your doing it, Graham :)

BTW, the docs are now at the new location - http://docs.couchcms.com/tags-reference ... cedit.html

http://www.couchcms.com/docs/ should redirect to http://docs.couchcms.com/

Please check and let us know if you find anything out-of-place.

Thanks.
15 posts Page 1 of 2
cron