User profiles in the Users plugin have been designed to make it as easy as possible to customize them, either with your own plugins or with a few template edits. Here's a quick example of how you could add a "website" field to a profile page:
1. Get the templates
As always, if you want to edit plugin templates, you should move them to your own theme folder first, so copy profile.php and edit_profile.php from
/content/plugins/users/templates/
to
/content/themes/YOUR_THEME/
2. Add an input box
Open edit_profile.php and scroll down to where there's a comment "Add your own profile fields here."
Above that, add
If you save and look at the profile edit page in your account, you should see a new field where you can enter your website url.PHP Code:<tr><td>Website: </td><td><input type="text" name="website" value="<?php echo $profile['website']; ?>"></td></tr>
3. Save the website url
To save that url when you click update, look near the top of edit_profile.php for a comment like "Add your own $profile['something'] stuff here."
Above that, add:
Note: testUri is an Inspekt filter. See other filters here.PHP Code:$profile['website'] = $h->cage->post->testUri('website');
4. Show the website url in the profile
Open profile.php and add the following wherever you want to show the website:
Finished.PHP Code:<a href="<?php echo $profile['website']; ?>">
<?php echo $profile['website']; ?>
</a>
You'll probably want to tidy that up with some extra HTML and/or CSS, but that's the basic process.


Reply With Quote

Bookmarks