Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Display new field and value in users backend from users tab
Hi,
If I add a new column in the users tab, is it a way to simply display this new field and value in the users backend?
Thanks
Nicolas
Last edited by NicolasGraph (2010-04-16 08:53:41)
Offline
Re: Display new field and value in users backend from users tab
NicolasGraph wrote:
If I add a new column in the users tab, is it a way to simply display this new field and value in the users backend?
You’ll need to write a little plugin to hook into the event=author_ui
/ step=extend_detail_form
which adds the necessary UI widget and then intercepts the ‘Save’ step to insert the value from your new field into the database. Look at the Extending textpattern section of the wiki and the Core Callback list for more info.
Alternatively, install smd_bio which is an entire system for adding arbitrary fields to your user table, allowing you to display the info on the public site if you wish as well.
Last edited by Bloke (2010-04-16 09:01:07)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Display new field and value in users backend from users tab
Hi Bloke,
Thank you for your answer!
I know smd_bio, but I think it doesn’t use the user tab and the fields are only visible by the admin.
I save new values with mem_self_register and I want users can modify these values in the backend.
I hope you understand my english :-/
Nicolas
Last edited by NicolasGraph (2010-04-16 09:11:47)
Offline
Re: Display new field and value in users backend from users tab
NicolasGraph wrote:
I know smd_bio, but I think it doesn’t use the user tab
It displays the fields on the Admin->Users tab, but it does not actually alter the txp_user table (it uses its own helper tables linked to the txp_user table).
and the fields are only visible by the admin.
That’s true. Only Publishers can edit the fields from the Admin->Users tab. However, mem_form / mem_simple_form and the smd_bio_info tag should allow you to grab the data from the smd_bio tables. Perhaps you could write a simple front-end User Profile Edit screen (using rvm_privileged ign_password_protect for authentication?) to allow people to administer their own profiles from there instead of using TXP’s back-end?
Just a thought.
Hmmm, maybe I should put some hooks into smd_bio to allow people to get at the smd_bio data more easily so this kind of thing is simpler to implement. If I get some time I’ll look into that possibility.
Last edited by Bloke (2010-04-16 09:28:23)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Display new field and value in users backend from users tab
Bloke a écrit:
Perhaps you could write a simple front-end User Profile Edit screen (using rvm_privileged ign_password_protect for authentication?) to allow people to administer their own profiles from there instead of using TXP’s back-end?
Yes, it’s a possibility but I tried ign_password_protect with TXP 4.2, and there are some bugs.
> http://forum.textpattern.com/viewtopic.php?id=8799&p=73
Just to understand : why smd_bio doesn’t use txp_users tab?
Last edited by NicolasGraph (2010-04-16 09:44:13)
Offline
Re: Display new field and value in users backend from users tab
NicolasGraph wrote:
I tried ign_password_protect with TXP 4.2, and there are some bugs.
Yes it’s a shame. But rvm_privileged is rock solid and if you’re clever you can give your users a seamless experience between admin and public side (I’ve seen it done and it’s brilliant).
Just to understand : why smd_bio doesn’t use txp_users tab?
It just seemed like the right thing to do at the time. Since txp_user is the key to authentication in TXP I didn’t really want to pollute it with arbitrary user-defined columns in case things went wrong. Plus I’m storing meta info about each column in a separate table anyway so I thought that one more table wouldn’t hurt :-)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Display new field and value in users backend from users tab
Bloke a écrit:
Yes it’s a shame. But rvm_privileged is rock solid and if you’re clever you can give your users a seamless experience between admin and public side (I’ve seen it done and it’s brilliant).
Ok, thanks.
I’ll try to be clever ! ;-)
Offline