Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
This is an example code i get from http://www.couchcms.com/docs/advanced-tutorial/create-view.html

Code: Select all
<cms:if k_success>
    <cms:db_persist_form
        k_page_title=frm_name
        k_page_name="<cms:random_name />"
        note_pad=frm_pad
        note_owner=k_user_id
    />   
    ...
</cms:if>

My question is, if i don't want a random name for k_page_name but an unique system generated name, how can i generate unique name ?
without using <cms:random_name /> ofcourse
Hi,

If you omit setting the 'k_page_name' parameter altogether, Couch by default will use the 'k_page_title' to create a unique name for the page (exactly what you see happening in the admin-panel with normal cloned pages).

So the following code should automatically give a unique human-readable name to all pages created -
Code: Select all
<cms:if k_success>
    <cms:db_persist_form
        k_page_title=frm_name
        note_pad=frm_pad
        note_owner=k_user_id
    />   
    ...
</cms:if>

Hope it helps.
Oh my dear lord !! why i can't figure that out ?!

thanks KK
3 posts Page 1 of 1