[[!SetResourcePlaceholders]]
[[!SetUserPlaceholders]]
The only ones it currently doesn't show though are the ClassExtender (which are just the arrival and departure dates), how can I add those ClassExtenders ones to the profile page to display or be updated on the "Manage profile" page too.
Displaying member profiles
using getUrlParam
Send members idCode to the page that will display their profile
<a href="[[~106? &val=`[[+idCode]]`]]">
ie: https://modx.andytough.com/profileview?val=R07D-07Z
Display their details on that page using GetExtUsers having
captured their idCode value using getUrlParam
The only ones it currently doesn't show though are the ClassExtender (which are just the arrival and departure dates), how can I add those ClassExtenders ones to the profile page to display or be updated on the "Manage profile" page too.
Displaying member profiles
using getUrlParam
Send members idCode to the page that will display their profile
<a href="[[~106? &val=`[[+idCode]]`]]">
ie: https://modx.andytough.com/profileview?val=R07D-07Z
Display their details on that page using GetExtUsers having
captured their idCode value using getUrlParam
The only ones it currently doesn't show though are the ClassExtender (which are just the arrival and departure dates), how can I add those ClassExtenders ones to the profile page to display or be updated on the "Manage profile" page too.
I think you need a snippet to call the ClassExtender db and get the data, but when I was looking for the answer I came upon a great resource from Andy, scroll down to the part about profiles.
https://andytough.com/assets/files/modx-meetup_adido_bournemouth_06-07-2017_andy-tough.pdf
A tasteDisplaying member profiles
using getUrlParam
Send members idCode to the page that will display their profile
<a href="[[~106? &val=`[[+idCode]]`]]">
ie: https://modx.andytough.com/profileview?val=R07D-07Z
Display their details on that page using GetExtUsers having
captured their idCode value using getUrlParam
The whole thing looks documented. Its brilliant!</a>
<?xml version="1.0" encoding="UTF-8"?> <model package="extendeduser" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" tablePrefix="ext_" version="1.0.0"> <!-- extend the modUser class --> <object class="extUser" extends="modUser"> <composite alias="Data" local="id" class="userData" foreign="userdata_id" cardinality="one" owner="local"/> </object> <object class="userData" table="user_data" extends="xPDOSimpleObject"> <field key="userdata_id" dbtype="int" precision="11" phptype="integer" null="false" attributes="unsigned"/> <field key="checkin" dbtype="date" precision="100" phptype="date" null="true"/> <field key="checkout" dbtype="date" precision="100" phptype="date" null="true"/> <field key="registrationDate" dbtype="datetime" phptype="datetime"/> <index alias="userdata_id" name="userdata_id" primary="false" unique="true" type="BTREE"> <column key="userdata_id" length="" collation="A" null="false"/> </index> <aggregate alias="User" class= "modUser" local="userdata_id" foreign="id" cardinality="one" owner="foreign"/> <aggregate alias="Profile" class="modUserProfile" local="userdata_id" foreign="internalKey" cardinality="one" owner="foreign"/> </object> </model>
<div class="x-form-item x-tab-item"> <label class="x-form-item-label" style="width:auto; font-weight:bold; float:none; font-size:12px">Arrival Date (dd/mm/yyyy)</label> <div class="x-form-item x-tab-item"> <input type="text" name="checkin" value="[[+checkin:strtotime:date=`%d/%m/%Y`]]" class="x-form-text x-form-field" onClick="Ext.getCmp('modx-panel-user').markDirty();"/> </div> </div> <div class="x-form-item x-tab-item"> <label class="x-form-item-label" style="width:auto; font-weight:bold; float:none; font-size:12px">Departure Date (dd/mm/yyyy)</label> <div class="x-form-item x-tab-item"> <input type="text" name="checkout" value="[[+checkout:strtotime:date=`%d/%m/%Y`]]" class="x-form-text x-form-field" onClick="Ext.getCmp('modx-panel-user').markDirty();"/> </div> </div>
createObjectContainer() failed
[[!SetUserPlaceholders]]
Did you change the snippet to this? And is the snippet above the placeholders?
[[!SetUserPlaceholders]]
[[+checkin:strtotime:date=`%d/%m/%Y`]]
If the data is being written to the correct field in the database, but is not displaying in the Manager I suspect there may be a problem with the text in your MyExtraUserFields chunk.
I have not got time to check at the moment (I'm popping out for a while) but I am not sure if the following is valid for this chunk...
[[+checkin:strtotime:date=`%d/%m/%Y`]]
I think you would use [[+checkin]] in your MyExtraUserFields chunk and then use [[+checkin:strtotime:date=`%d/%m/%Y`]] when displaying the date in the front end.
Bob will know though. I may be completely wrong here.
As a matter of interest what version of MODX are you using? I encountered the error createObjectContainer() failed when seeing if I could install ClassExtender in the alpha of version 3, 'MODX 3.0.0-dev'.
<div class="x-form-item x-tab-item"> <label class="x-form-item-label" style="width:auto; font-weight:bold; float:none; font-size:12px">Arrival Date (dd/mm/yyyy)</label> <div class="x-form-item x-tab-item"> <input type="text" name="checkin" value="[[+checkin]]" class="x-form-text x-form-field" onClick="Ext.getCmp('modx-panel-user').markDirty();"/> </div> </div> <div class="x-form-item x-tab-item"> <label class="x-form-item-label" style="width:auto; font-weight:bold; float:none; font-size:12px">Departure Date (dd/mm/yyyy)</label> <div class="x-form-item x-tab-item"> <input type="text" name="checkout" value="[[+checkout]]" class="x-form-text x-form-field" onClick="Ext.getCmp('modx-panel-user').markDirty();"/> </div> </div>
[[!Profile]] [[!SetUserPlaceholders]] <h4>Details for user [[+username]]</h4> <p>Email: [[+email]]</p> <p>Full Name: [[+fullname]]</p> <p>Phone: [[+phone]]</p> <p>Mobile: [[+mobilephone]]</p> <p>Website: [[+website]]</p> <p>Address: [[+address]]</p> <p>Address: [[+address2]]</p> <p>City: [[+city]]</p> <p>Postal Code: [[+zip]]</p> <p>Country: [[+country]]</p> <p>Arrival Date: [[+checkin:strtotime:date=`%d/%m/%Y`]]</p> <p>Departure Date: [[+checkout:strtotime:date=`%d/%m/%Y`]]</p> <p> </p> <hr /> <p><small>Please visit <a data-ajax="false" href="[[~60]]" title="Customer Portal" >Update Profile</a> area if you wish to amend your details.</small></p>
<?xml version="1.0" encoding="UTF-8"?> <model package="extendeduser" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" tablePrefix="ext_" version="1.0.0"> <!-- extend the modUser class --> <object class="extUser" extends="modUser"> <composite alias="Data" local="id" class="userData" foreign="userdata_id" cardinality="one" owner="local"/> </object> <object class="userData" table="user_data" extends="xPDOSimpleObject"> <field key="userdata_id" dbtype="int" precision="11" phptype="integer" null="false" attributes="unsigned"/> <field key="checkin" dbtype="date" precision="100" phptype="date" null="true"/> <field key="checkout" dbtype="date" precision="100" phptype="date" null="true"/> <index alias="userdata_id" name="userdata_id" primary="false" unique="true" type="BTREE"> <column key="userdata_id" length="" collation="A" null="false"/> </index> <aggregate alias="User" class= "modUser" local="userdata_id" foreign="id" cardinality="one" owner="foreign"/> <aggregate alias="Profile" class="modUserProfile" local="userdata_id" foreign="internalKey" cardinality="one" owner="foreign"/> </object> </model>