Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
18 posts Page 2 of 2
had to add static to handle_params() methods within a few classes to get this to work with Couch 2.0

I think that issue has to do with PHP7, not v2.0 of Couch.

Thanks for giving me a nudge. I'll get an update posted soon to correct it.
Hi, i did install the HTML5 tags addon on my Couch, im not using Couch 2.0. And the input tags are working.

But when im saving the data dont get saved. Must i add something to db_persist or something or is there anything else im doing wrong.

Code: Select all
        <cms:form 
            masterpage=k_user_template
            mode='edit'
            page_id=k_user_id
            enctype="multipart/form-data"
            method='post'
            anchor='0'
            >

            <cms:if k_success >
                <cms:db_persist_form />

                <cms:if k_success >
                    <cms:set_flash name='success_msg' value='1' />
                    <cms:redirect 'profile-user.php' />
                </cms:if>
            </cms:if>

            <div class="col-md-2">
                   <div class="form-group">
                           <label>Mobil:</label>
                           <cms:input name='mobil' type="tel" class="form-control" />
                   </div>
            </div>
<div class="panel panel-flat">
    <div class="panel-body">
        <div class="row">
            <div class="col-md-12">
                <button type="submit" class="btn btn-primary" style='width:100%;'>OPPDATER OPPLYSNIGNER <i class="icon-arrow-right14 position-right"></i></button>
            </div>
        </div>
    </div>
</div>   

</cms:form>
@heggeneskim, Hi :)

Only cms:inputs of type 'bound' get persisted automatically (that is what the term 'bound' suggests).

Any other type you choose to use in the form, needs to be explicitly persisted. As an example, assuming your template has an editable region named 'phone' and the form has an input named 'mobile', the following will push the value submitted in 'mobile' into the 'phone' editable region -
Code: Select all
<cms:db_persist_form
    phone = frm_mobile
/>

Please do notice that the variable we have used above is named 'frm_mobile' and not simply 'mobile' because, as explained in the docs on forms (http://docs.couchcms.com/concepts/forms.html), Couch prefixes 'frm_' to all input names in the success condition.

If you wish, you may search the forum and you can find many examples of <cms:db_persist_form> usage.

Hope it helps.
not works with couch2 and couch2.1beta
@andrejprus, seems to be working just fine for me on both versions.
What exactly is not working for you? Please post the code you are using.
@KK

i download zip file from 1 post attachment

Image

then:
Image

then trying to use type="color"
Image

and at output in browser at front-end I have:
Image
The addon actually only adds new <cms:input> types and not <cms:editable> types.
That is to say, those HTML5 inputs are meant to be used on front-end forms e.g.
Code: Select all
<cms:form> 
    ..
    <cms:input type='email' name='email' validate='0' required='1' />
    ..
</cms:form>

Hope that explains the perceived problem.
ooh, understood.. in <cms:form> thank u!!!
18 posts Page 2 of 2

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests