Skip to:
Content
Pages
Categories
Search
Top
Bottom

Which template file is Settings?


  • peterverkooijen
    Participant

    @peterverkooijen

    Dumb question of the day (9.30 pm, should get some dinner…):

    Which template file produces /members/funnyusername/settings/ in version 1.1.3?

Viewing 8 replies - 1 through 8 (of 8 total)

  • Brajesh Singh
    Participant

    @sbrajesh

    For the layout , It uses ‘plugin-template.php’

    The output(the settings data) and generated by the core. If you want to change the layout, customize ‘plugin-template.php’


    peterverkooijen
    Participant

    @peterverkooijen

    Thanks Brajesh Singh!

    This is a puzzling part of the theme structure. I’ve added some of my generic page elements to the file, but now I need to figure out how to style the form – change password.

    How is the settings data generated? There’s only this in plugin-template.php:

    <?php do_action('bp_template_content') ?>

    I can trace back includes and most functions, but this could be anything. Where does the form come from? How does the system know which template content? Is it only the ‘change password’ form or can other settings use this same plugin-template.php? Is plugin-template.php meant to bring settings from plugins into the front end? Why was this file introduced?

    Settings template is hardcoded at the moment (yes, we know). That file is a remnant from an earlier version of BuddyPress that was meant to make it easier to create one-screen plugins.


    peterverkooijen
    Participant

    @peterverkooijen

    Thanks DJ Paul.

    So I guess I should fix the form via CSS somehow for now? Is the ‘change password’ form the only bp_template_content? I don’t even get a title or something like that with it, so I’d have to add that to plugin-template.php I guess.


    Brajesh Singh
    Participant

    @sbrajesh

    yes, you have to fix it via css.

    No, change password for is not the only one. almost all the core settings(core notification/password change) and many plugins use this plugin-template.php for showing the content.

    Please check do you have this tag in your plugin template.php

    <?php do_action('bp_template_title') ?>

    This is used for showing the title, you should never hard code the title there.


    peterverkooijen
    Participant

    @peterverkooijen

    Thanks Brajesh Singh.

    That line was missing. It produces ‘General Settings’. No obvious way to edit that… :-(

    Look at bp-core-settings.php in the bp_core_screen_general_settings() function. It is the line that begins

    add_action( ‘bp_template_title….

    which sets the title. It calls the bp_core_screen_general_settings_title() function which returns the title. Two options – create a custom language file and translate the title there, or figure out where/how to remove_action that line.


    brianbuffon
    Member

    @brianbuffon

    I’m not sure what the template file was called in 1.1.3, but in ver. 1.2.3 it is just “plugins.php” in case anyone reads this post wondering why “plugin-template.php” wasn’t returning any results when searched for.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Which template file is Settings?’ is closed to new replies.
Skip to toolbar