We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23299
    • 1,161 Posts
    I have a general question if I may...

    Is it OK to shorten the WebLoginPE Registration? I would like to try this snippet for a small informal local club. My view is that in this instance the fields for stuff like fax number, country, state, date of birth, gender etc are not needed.

    I would also like to drop all the legal looking text: Web Site Terms and Conditions of Use. This site will be a small friendly club: everyone knows each other and there is no commercial entity involved etc.

    If the answers to these questions is yes then how would I go about making these changes?

    Thanks!
      • 26435
      • 1,193 Posts
      WebLoginPE is released under the GPL. You are free to modify it in any way you see fit to suit your needs. WebLoginPE has many parameters to help you customize every aspect of your user interface. See http://docs.webloginpe.info/views.html for information on all the parameters for modifying the user interface with MODx chunks.

      -sD-
      Dr. Scotty Delicious, DFPA.

        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Simple answer, yes.

        In the documentation (docs folder of the webloginpe zip archive), check out the "Views (templates)" page.

        Generally what I do is copy the default templates into the chunk I intend to use as the form view template, add the template parameter to the snippet call and make sure that works, then start modifying the chunk until it’s the way I want it.

        You’ll be interested in the section on the &registerTpl template.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 23299
          • 1,161 Posts
          Much thanks to you both for your quick response!

          I will do some digging into those files.

          Max

          PS: I am in awe of folks who can write this stuff...
            • 23299
            • 1,161 Posts
            OK, I have looked at the views html page.

            I think I will break this down into two parts. I think the first mission will be to change/shorten the Terms Of Service section of the register form.

            Rather than deleting the whole thing I think I should just make it much shorter and simpler. This way I avoid screwing up any of the code line (I know nothing about PHP and I struggle with reading the stuff on how to implement these snippets.) Can I directly edit the defaultTOSTpl.html within the Default Forms folder in the WebLoginPE install and make it read the way I want? Or do I have to make a custom call to a chunk I need to create? Changing html I can with few problems.

            Once I have figured this out I will move on to removing the country, fax machine entries in the register form.

            Thanks!
              • 28033
              • 925 Posts
              If you want to remove a big chunk of stuff like the ToS, just put a block comment around it. HTML uses something like <!----, and I can’t remember ATM what the PHP equivilant is.

              Doing that will stop that from appearing, but won’t accidentally mess up the code. There’s some things in WLPE that mess up when parts are removed for some reason (at least on my install), so this is very useful.
                My Snippets
                -> PopUpChunk v1.0
                • 23299
                • 1,161 Posts
                I still don’t get where I would make the changes. I tried cutting most of the lines from the defaultTosTpl.html file in the forms folder. Obviously that is not what I should be doing...
                  • 23299
                  • 1,161 Posts
                  I am reading Susan’s paragraph that reads:

                  "Generally what I do is copy the default templates into the chunk I intend to use as the form view template, add the template parameter to the snippet call and make sure that works, then start modifying the chunk until it’s the way I want it."

                  I am trying to wrap my head around this. I know that there is a lot going on in this sentence but I don’t get it. Sorry...

                  I think not knowing any PHP is just killing me with MODx. If I look in the Manager I see no templates for this snippet. I have a test page on my site with the following snippet call: [!WebLoginPE?!]. That’s it. It seems to call the WebLoginPE just fine. I thought I could edit the html file in the forms folder but I realize I am way off base there. I know Susan’s statement is sort of the "Cliff Notes" involved in getting the changes made. I think I need the "long version..."
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    This has nothing to do with PHP.

                    The default view template for the registration form is:
                    [+wlpe.message+]
                    <div id="wlpeNewUser">
                    	<form id="wlpeUserRegisterForm" action="[~[*id*]~]" method="POST" enctype="multipart/form-data">
                    		<fieldset id="wlpeUserRegisterInput">
                    			<div id="wlpeNewUserInfo">
                    				<p id="wlpeRegisterInfo">Use this form to register for a new user account.<br />
                    					<span class="info">Filds marked with <span class="required">*</span> are required.</span>
                    				</p>
                    			</div>
                    			<legend>Register for a new user account</legend>
                    			<label for="wlpeUserRegisterEmail"><span class="required">*</span> Email
                    			<input id="wlpeUserRegisterEmail" type="text" name="email" value="[+post.email+]" />
                    			</label>
                    
                    			<label for="wlpeUserRegisterUserName"><span class="required">*</span> Desired User Name
                    			<input id="wlpeUserRegisterUserName" type="text" name="username" value="[+post.username+]" />
                    			</label>
                    
                    			<label for="wlpeUserRegisterFullName"><span class="required">*</span> Full Name
                    			<input id="wlpeUserRegisterFullName" type="text" name="fullname" value="[+post.fullname+]" />
                    			</label>
                    
                    			<label for="wlpeUserRegisterPassword"><span class="required">*</span> Password
                    			<input id="wlpeUserRegisterPassword" type="password" name="password" value="[+post.password+]" />
                    			</label>
                    
                    			<label for="wlpeUserRegisterPasswordConfirm"><span class="required">*</span> Password (confirm)
                    			<input id="wlpeUserRegisterPasswordConfirm" type="password" name="passwordconfirm" value="[+post.passwordconfirm+]" />
                    			</label>
                    
                    			<label for="wlpeUserRegisterPhone">Phone number
                    			<input id="wlpeUserRegisterPhone" type="text" name="phone" />
                    			</label>
                    
                    			<label for="wlpeUserRegisterMobile">Mobile number
                    			<input id="wlpeUserRegisterMobile" type="text" name="mobilephone" value="[+post.mobilephone+]" />
                    			</label>
                    
                    			<label for="wlpeUserRegisterFax">Fax number
                    			<input id="wlpeUserRegisterFax" type="text" name="fax" value="[+post.fax+]" />
                    			</label>
                    
                    			<label for="wlpeUserRegisterState">State
                    			<input id="wlpeUserRegisterState" type="text" name="state" value="[+post.state+]" />
                    			</label>
                    
                    			<label for="wlpeUserRegisterZip">Zip Code
                    			<input id="wlpeUserRegisterZip" type="text" name="zip" value="[+post.zip+]" />
                    			</label>
                    
                    			[+form.country+]
                    
                    			<label for="wlpeUserRegisterDob">Date of birth <span class="info">(DD-MM-YYYY)</span>
                    			<input id="wlpeUserRegisterDob" type="text" name="dob" value="[+post.dob+]" />
                    			</label>
                    
                    			[+form.gender+]
                    			
                    			<img id="wlpeUserDefaultImage" src="[+user.defaultphoto+]" alt="Default User Image" title="Default User Image" height="100" width="100" />
                    			
                    			<label for="wlpeUserProfilePhoto" id="photolabel">User Photo
                    			<input id="wlpeUserProfilePhoto" type="file" name="photo" />
                    			</label>
                    			<p id="wlpeUserProfilePhotoInfo" class="info">No bigger than 100kb. will be resized to 100 x 100.</p>
                    			
                    			<label for="wlpeUserRegisterComment">Comment/Signature
                    			<textarea id="wlpeUserRegisterComment" name="comment">[+post.comment+]</textarea>
                    			</label>
                    			
                    			<img id="wlpeCaptchaImage" src="[+form.captcha+]" width="148" height="60" alt="If you have trouble reading the code, click on the code itself to generate a new random code." />
                    			
                    			<label for="wlpeUserRegisterCaptcha" id="wlpeCaptchaLabel"><span class="required">*</span>Please enter the code in the image.
                    			<input type="text" id="wlpeUserRegisterCaptcha" name="formcode" >
                    			</label>
                    			
                    			<p id="wlpeTermsOfServiceLabel">Terms of Service/Privacy Policy</p>
                    			<div id="wlpeTermsOfService">[+tos+]</div>
                    			
                    			<label for="wlpeTosCheckbox" id="wlpeTosCheckboxLabel"><span class="required">*</span>I accept the Terms of Service
                    				<input type="checkbox" id="wlpeTosCheckbox" name="tos" />
                    			</label>
                    			
                    		</fieldset>
                    		<fieldset id="wlpeUserRegisterButtons">
                    			<button type="submit" id="wlpeSaveRegisterButton" name="service" value="register">Register</button>
                    			<button type="submit" id="wlpeCancelRegisterButton" name="service" value="cancel">Cancel</button>
                    		</fieldset>
                    	</form>
                    </div>

                    This is in the Default Forms folder of the unzipped archives, the file named defaultRegisterInstantFormTpl.html.txt

                    The default view templates in this case are not in the database, but are in the Default Forms folder. I prefer to leave those alone and use a chunk instead.

                    Create a new chunk in the Manager, Resources->Manage Resources, the Chunks tab. Copy/paste the text from the above .txt file into the chunk. Now in your snippet call on the page where you want the form to appear, put &registerTpl=`theNameofYourChunk` (note that those are backticks, not single quotes) to tell WebLoginPE what to use for the form. At this point you should be able to view the page and not see any difference.

                    Now, edit that HTML in the chunk until the form is the way you want it. Check from time to time to make sure nothing is totally broken.

                    The [+...+] placeholders are described in the "Placeholders" section of the documentation (the Docs folder in the unzipped archive). For example, the [+tos+] placeholder will insert the TOS template in that spot. So if you don’t want that, just leave it out of your form.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 23299
                      • 1,161 Posts
                      Thanks again.

                      I have one question: how would the snippet call look now?
                      AT the moment I have the following: [!WebSignup? &groups=’Gallery Users’!] 
                      with Gallery users being a web users group I I am trying to establish...
                      Does this new chunk I just created get inserted into this snippet call?

                      Would this be correct: [!WebSignup? &groups=’Gallery Users’ &registerTpl=`registerform`!]

                      Thanks,

                      Max