Skip to:
Content
Pages
Categories
Search
Top
Bottom

Settings Page Template File – Please?!

  • @hempsworth

    Participant

    A lot of theme developers are desperate to be able to modify the look of the ‘/username/settings’ pages – at present the only way is to edit ‘plugin-template.php’ – which certainly isn’t ideal!

    The page is a lot like the ‘Edit Profile’ page, so it would make sense to me to have a ‘edit-settings.php’ file in the BP member theme. With the option for a tag like this:

    <?php bp_edit_settings_form() ?>

    The outputted HTML should also be more inline with that outputted by ‘bp_edit_profile_form()’:

    <div id="content">
    <h2>General Settings</h2>
    <form>
    <p>
    <ul>
    <li><label class="settings-label">Account Email</label><input class="settings-input" /></li>
    <li><label for="pass1">Change Password <span>(leave blank for no change)</span></label></li>
    </ul>
    </p>
    </form>

    This would make the theming of these similar pages far easier, and mean less CSS! If we just copy what was done with the ‘profile/edit.php’ theme file, we should be able to do the same with settings?

Viewing 3 replies - 1 through 3 (of 3 total)
  • @hempsworth

    Participant

    I’m not a big coder, but I’ll have a try of porting it over to a template tag… Using edit.php as a reference…

    @hempsworth

    Participant

    The furthest I can get is patching up the ‘wp-core-settings.php’ file to output the HTML i defined above. I’ll submit a patch to trac if people agree this is the way we should go – ie. having a similar HTML structure for both the ‘edit settings’ and ‘edit profile’ pages.

    @hempsworth

    Participant

    The only change I’m actually going to propose is this:

    function bp_core_screen_general_settings_content() {
    global $bp, $current_user, $bp_settings_updated, $pass_error; ?>

    <?php if ( $bp_settings_updated && !$pass_error ) { ?>
    <div id="message" class="updated fade">
    <p><?php _e( 'Changes Saved.', 'buddypress' ) ?></p>
    </div>
    <?php } ?>

    <?php if ( $pass_error && !$bp_settings_updated ) { ?>
    <div id="message" class="error fade">
    <p><?php _e( 'Your passwords did not match', 'buddypress' ) ?></p>
    </div>
    <?php } ?>

    <form action="<?php echo $bp->loggedin_user->domain . 'settings/general' ?>" method="post" id="settings-form">
    <p>
    <ul>
    <li><label for="email" class="settings-label"><?php _e( 'Account Email', 'buddypress' ) ?></label> <input type="text" name="email" id="email" value="<?php echo attribute_escape( $current_user->user_email ); ?>" class="settings-input" /></li>
    <li><label for="pass1" class="settings-label"><?php _e( 'Change Password <span>(leave blank for no change)</span>', 'buddypress' ) ?></label> <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small" /></li>
    <li><label for="pass2" class="settings-label"><?php _e( 'Repeat Password <span>(leave blank for no change)</span>', 'buddypress' ) ?></label> <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small" /></li>
    </ul>
    </p>
    <p class="submit"><input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?>" id="submit" class="auto"/></p>
    <?php wp_nonce_field('bp_settings_general') ?>
    </form>
    <?php
    }

    If I can’t get this in core, how can I make sure these HTML changes persist after upgrades? Can I make a small plugin to do this?! I’m a real PHP n00b…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Settings Page Template File – Please?!’ is closed to new replies.
Skip to toolbar