• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

Adding instagram field on profile page

altsupport

Chevereto Member
Hoping someone can help point me in the right direction. I want to add another field on the profile page (settings/profile) for an instagram username.

I added the input label below and added the column user_insta in the users table in the database. It displays properly after i manually enter the text directly into the database but when I click Save Changes it does not write back to the database. I can't find the code for writing back to the database on this form.

<div class="input-label">
<label for="insta"><?php _se('Instagram'); ?></label>
<input type="text" name="insta" id="insta" class="text-input" value="<?php echo get_user()["insta"]; ?>" data-validate rel="tooltip" title="<?php _se('Instagram Username'); ?>" data-tipTip="right" placeholder="<?php _se('Instagram Username'); ?>">
<span class="input-warning red-warning"><?php echo get_input_errors()["insta"]; ?></span>
</div>


Thanks
 
The code you described only does the form display, it doesn't touch the database at all. You don't get anything saved because the alleged field doesn't exists in the user table.

You need to alter the user table and the related classes to reflect that data relationship.
 
Thanks for the reply. The field does exist in the users table (user_insta). So should i be editing the class.user.php?
 
app/lib/classes/class.user.php controls the interaction with the table, and the fill method prepares the additional data you may need to format.

The most relevant file for your customization is app/routes/route.settings.php as it process the post form.
 
Awesome, thanks! I just needed to add 'insta' to editable values on line 44 of app/routes/route.settings.php then move route.settings.php to the overrides folder.
 
Back
Top