Important announcements from CouchCMS team
80 posts Page 8 of 8
Previous 1 ... 4, 5, 6, 7, 8 Next
KK wrote: @setiawanfarlin, just in case it is not sufficiently clear to you from @trendoman's example, you can use the k_page_name variable as follows -
Code: Select all
<cms:pages masterpage='students.php'  custom_field="take=<cms:show k_page_name />"  >

Remember, the double-quotes used while setting any parameter allow you to execute any arbitrary Couch code enclosed within them (in our case we use cms:show to output the variable's values).


Sorry for late reply

I missed that id and tag part, its working right now.

Thank you very much @KK and @trendoman.
I have registration form with this code:

Code: Select all
<!--Name:<br />-->
                <cms:input name='ver_name' type='bound' class="form-control" placeholder="Your full name" label="Your full name" /><br />

                <!--Company:<br />-->
                <cms:input name='ver_company' type='bound' class="form-control" placeholder="Company" /><br />

                <!--Occupation title:<br />-->
                <cms:input name='ver_occtitle' type='bound' class="form-control" placeholder="Occupation title" /><br />
               
                <!--Email Address:<br />-->
                <cms:input name='extended_user_email' type='bound' class="form-control" placeholder="Your email" /><br />
                   
                <!--Password:<br />-->
                <cms:input name='extended_user_password' type='bound' class="form-control" placeholder="Password" /><br />
               
                <!--Repeat Password:<br />-->
                <cms:input name='extended_user_password_repeat' type='bound' class="form-control" placeholder="Repeat password" /><br />       
               
                <input type="submit" name="submit" value="Create account" class="btn btn-primary btn-subscribe btn-lg" />   


On users/index.php I created fields:

Code: Select all
<cms:editable name='ver_name' required='0' type='text' label='Name' />
<cms:editable name='ver_company' required='1' type='text' label='Company' />
    <cms:editable name='ver_occtitle' required='1' type='text' label='Occupation title' />



I'm receiving this error "Name: Only Lowercase characters, numerals, hyphen and underscore permitted".
How to fix that? Because that "Name" will not be username, client would have to put their full name there. They would login with their email and password.
@derKaiser, every cloned page has two system fields - name and title. The message you are getting seems to pertain to that name field.

If you don't want to use, the conventional way is to set it to random as follows -
Code: Select all
<cms:db_persist_form 
    _invalidate_cache='0'
    k_page_name = "<cms:random_name />"
    k_page_title = "<cms:show frm_ver_name />"
/>

In the code above I have also set the second system field (the title) to hold the same value as that in your custom field 'ver_name'. .
In fact, you could do away with 'ver_name' altogether and just use k_page_title for the full name.

Hope it helps.
@KK, still getting the same error "Name: Only Lowercase characters, numerals, hyphen and underscore permitted"
Please PM me the full code that you are using.
Fixed.

Code: Select all
 <cms:db_persist_form 
                        _invalidate_cache='0'
                        k_page_name = "<cms:random_name />"
                        k_publish_date = '0000-00-00 00:00:00'
                    /> 


Code: Select all
<!--Name:<br />-->
                <cms:input name='k_page_title' type='bound' class="form-control" placeholder="Your full name" label="Your full name" required /><br />

                <!--Company:<br />-->
                <cms:input name='ver_company' type='bound' class="form-control" placeholder="Company" /><br />

                <!--Occupation title:<br />-->
                <cms:input name='ver_occtitle' type='bound' class="form-control" placeholder="Occupation title" /><br />
               
                <!--Email Address:<br />-->
                <cms:input name='extended_user_email' type='bound' class="form-control" placeholder="Your email" required /><br />
                   
                <!--Password:<br />-->
                <cms:input name='extended_user_password' type='bound' class="form-control" placeholder="Password" /><br />
               
                <!--Repeat Password:<br />-->
                <cms:input name='extended_user_password_repeat' type='bound' class="form-control" placeholder="Repeat password" /><br />       


---------

Another thing, how to remove the option that users receives email to confirm his account (activation link)? I don't need that function..
Does someone know how to fix that?
how to remove the option that users receives email to confirm his account (activation link)? I don't need that function..

Take a look at the code you are using (it should be something like the following sample used in the docs of extended users)
Code: Select all
<cms:if k_success >        

                    <cms:check_spam email=frm_extended_user_email />           

                    <cms:db_persist_form
                        _invalidate_cache='0'
                        k_page_name = "<cms:random_name />"
                        k_publish_date = '0000-00-00 00:00:00'
                    />                   

                    <cms:if k_success >
                       
                        <cms:send_mail from="<cms:php>echo K_EMAIL_FROM;</cms:php>" to=frm_extended_user_email subject='New Account Confirmation' debug='1'>
                            Please click the following link to activate your account:
                            <cms:activation_link   frm_extended_user_email   />

                            Thanks,
                            Website Name
                        </cms:send_mail>                       
                                               
                        <cms:set_flash name='success_msg' value='1' />
                        <cms:redirect k_page_link />
                    </cms:if>
                </cms:if>

You'll see that in the success block following <cms:db_persist_form >, the code is using <cms:send_mail> to send an activation mail to the user.

If you don't want that functionality, simply remove that <cms:send_mail> statement.

Now since the user won't be able to activate the account herself, the onus of doing so will be on the administrator who will have to 'publish' the accounts to activate them.

Therefore it would be prudent in such cases to send an email to the administrator instead informing her of the fact that a new account has been created that needs her attention.

The revised code could become (the embedded snippet will send mail to the admin ) -
Code: Select all
<cms:if k_success >
                       
    <!-- send intimation email too admin -->
    <cms:embed 'emails/account_registration.html' />                       
                           
    <cms:set_flash name='success_msg' value='1' />
    <cms:redirect k_page_link />
</cms:if>
Code: Select all
emails/account_registration.html


And what should this snippet have in it?
And what should this snippet have in it?
Code to send email to the admin.

Example -
Code: Select all
<cms:send_mail from=k_email_from to=k_email_to subject='Account registered'> 
Hey Admin,

A new account has been registered -
Email: <cms:show frm_extended_user_email />

Please visit the admin-panel to activate the account.
</cms:send_mail>
Previous 1 ... 4, 5, 6, 7, 8 Next
80 posts Page 8 of 8
cron