Tutorial: Packs Userspace - add more data fields |
Post Reply ![]() |
Author | |
Dmit OE ![]() Admin Group ![]() Joined: May 31 2012 Status: Offline Points: 5283 |
![]() ![]() ![]() ![]() ![]() Posted: Mar 19 2016 at 1:28pm |
Hi,
The Packs "Userspace01" (user management and page protection) does not allow to directly add more data to accounts. There's however a workaround for this. Due to lack of time, I won't look into modifying the Edit Account page, just New Account and reading stored data. Upon request and with more free time I may look into Edit Account and add it later. 1) If you haven't installed the Packs yet: find the Packs tab/panel on the right, open Userspace01, and use Automatic installation option. As indicated, make sure to open the Admin page (one with the Pack #10) in local preview then, after uploading the website, online as well, to initilalize the database. 2) On the page New Account (one with Pack 30), hide the big "info" field - uncheck Properties->Visible - and add Properties->Custom Class "comb-info" (without ""). This field will "collect" all extra data fields. (Each time I have to tell without "" because there is always someone who puts "" otherwise..) 3) Add your additional elements-fields (ex. "Occupation", "Age" etc.), set their Properties->Attribute Name as needed - you will use these to access the data. On each of these elements, add Properties->Custom Classes "add-info" (yes, still without ""). 4) Add a Code Block (Source) type Javascript position Header with the code:
This will, on each change of any "additional field", collect all data from all fields and store them into the invisible "info" field. Which, in turn, will be saved to the database by Packs on creating the account. That's all you need to STORE the data into the database. Next post will be about getting this stored data. Edited by Dmit OE - Mar 19 2016 at 1:52pm |
|
![]() |
|
Dmit OE ![]() Admin Group ![]() Joined: May 31 2012 Status: Offline Points: 5283 |
![]() ![]() ![]() ![]() ![]() |
Part 2 - showing stored data.
On a page that needs to show the data, use (if not already done) the Pack 70. It provides elements-fields for all built-in data, including "info" that stores all additional data. Add elements-fields corresponding to all datas you want to get. For example, if you had the field named "age"on New Account page, add a field with the same Properties->Attribute Name "age" (yes yes still without ""). Delete all elements-fields added by the Pack that you don't need. Make the "info" field invisible and put the Properties->Custom Classes "comb-info" as discussed in the previous post. Now, all you need to do is add a Code Block Source type Javascript position Header with the code:
Edited by Dmit OE - Mar 19 2016 at 1:53pm |
|
![]() |
|
Dmit OE ![]() Admin Group ![]() Joined: May 31 2012 Status: Offline Points: 5283 |
![]() ![]() ![]() ![]() ![]() |
P.S. Normally on Edit Account page you should just use the combination of the two parts described above, but I don't have time to test it atm.
You are welcome to give your feedback esp. if it does not work, I will fix and update the tutorial. |
|
![]() |
|
Otoole ![]() Newbie ![]() ![]() Joined: Oct 20 2017 Status: Offline Points: 1 |
![]() ![]() ![]() ![]() ![]() |
This is exactly what I've been looking for. Thanks for the efford and sharing!
Edited by Otoole - Jul 01 2019 at 7:01am |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |