Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Editing User "Homepage"

  • Avatar of MrMarkG
    MrMarkG
    Participant

    @mrmarkg

    So I’ve updated my design based on the advice from DanBP and I’ve got much further.

    Now, I used “bp_loggedin_user_domain()” to take the user to their “Homepage”. However, I’m having trouble working out which templates and parts BuddyPress uses to create the page. I’ve worked out that home.php loads the tabs for the various BP options you have enabled, but before that there is a link to users homepage under their name.

    I’ve uploaded a screenshot here: http://mark.gads.by/username.png

    Basically, I can’t find where the lower “Michellie” is created (ignore the debug text I’ve drawn through). Ideally I’d only want to show that user name if the logged in user wasn’t Michellie.

    Once I’ve removed that I can work on styling the rest of the data.

    Any ideas?

    Many thanks,

    Mark

Viewing 9 replies - 1 through 9 (of 9 total)
  • Avatar of danbp
    danbp
    Moderator

    @danbp

    Any theme contains a page.php or buddypress.php if you use a child theme.

    The username is coded like this:
    <h1 class="entry-title"><?php the_title(); ?></h1>

    You simply add your conditionnal around the h1 line

    if (….)
    h1 the title
    endif

    Don’t see exactly from where the name on the top right is coming. Is it the one on the Toolbar (howdy) ?
    Give the code

    Avatar of MrMarkG
    MrMarkG
    Participant

    @mrmarkg

    Is there an example page.php or buddypress.php in the BP install that I could copy into my theme? I didn’t see one.

    The name on the top right comes from my own toolbar which uses bootstrap styles:

      <nav class="navbar navbar-default" role="navigation">
      <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
        </div>
    
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse navbar-inverse navbar-fixed-top" id="bs-example-navbar-collapse-1">
          <ul class="nav navbar-nav">
    	    <?php wp_list_pages(array('title_li' => '')); ?> 
          </ul>
    	  <ul class="nav navbar-nav navbar-right">
    	  <?php if ( is_user_logged_in()) : 
    			  // get the currently logged-in user
    			$user = wp_get_current_user(); ?>
    			<li><a href="<?php echo bp_loggedin_user_domain(); ?>"">
    			<button type="button" class="btn btn-info">
    			<span class="glyphicon glyphicon-envelope"></span> 
    			<span class="badge"><?php bp_total_unread_messages_count() ?></span>
    			</button>
    			<?php // echo the user's display_name
    			 echo $user->display_name; ?>
    			 
    			  </a>
    			</li>
    			</ul>
    	  <?php else: ?>	
          <form class="navbar-form" role="login">
            <div class="form-group">
              <input type="text" class="form-control" placeholder="User Name">
    		  <input type="text" class="form-control" placeholder="Password">
            </div>
            <button type="submit" class="btn btn-default">Login</button>
          </form>
    	  </ul>
    	    <?php endif; ?>

    Again, if I’m doing the toolbar wrong, let me know, but I have a very particular style guide I need to use.

    Thanks very much!

    Mark

    Avatar of danbp
    danbp
    Moderator

    @danbp

    I guess the top right name is made with echo $user->display_name;

    As you added an ELSE clause after the UL end tag, it would probably be better to hide the whole UL to avoid html errors to not logged visitors.

    Invert

    <ul class="nav navbar-nav navbar-right">
    	  <?php if ( is_user_logged_in()) : 

    to this

    <?php if ( is_user_logged_in()) : 
    <ul class="nav navbar-nav navbar-right">

    You have a page.php in the wordpress themes (2012, 2013, 2014).

    You make a copy and rename it buddypress.php and load it into your custom theme.

    If not already done, i recommend you to read attentively this on WP codex:

    http://codex.wordpress.org/Theme_Development

    and also this

    http://codex.buddypress.org/themes/

    http://codex.buddypress.org/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/

    Avatar of henrywright
    henrywright
    Moderator

    @henrywright

    Regarding your Bootstrap navbar markup, it doesn’t look quite right to me. For example navbar-fixed-top should be a class on <nav>

    See: http://getbootstrap.com/components/#navbar-fixed-top

    Avatar of MrMarkG
    MrMarkG
    Participant

    @mrmarkg

    Henry – thanks for spotting that. I’ll fix it.

    DanBP – maybe if I explain what I am trying to do, you can explain whether I am veering of course or not.

    Basically I am creating a paid membership site. I will have 4-5 pages outside of BP (that I am currently using regular WP for) that will advertise the site, then I need a pages for members that will let them send each other messages and also sign up for events. If I understand what you are saying, I would then have one page called “buddypress.php” that would manage this functionality?

    Many thanks for your help. I’ll read the links you sent me and I’m also working my way through BuddyPress Theme Development as I have a Safari Account via work.

    Regards,

    Mark

    Avatar of danbp
    danbp
    Moderator

    @danbp

    I need a pages for members that will let them send each other messages

    if you enable BP’s Private message component, the built-in message system will let each user send message to other members.

    http://codex.buddypress.org/buddypress-components-and-features/messages/

    Except if i misunderstood you, i don’t see the utility to add an extra page for this.

    Depending of which plugin you use to manage events, a subscribe to event page is most probably included in the plugin.

    If messaging and event are your only need, you’re going overcomplicated for the moment. The only thing you have to do, i think, is to install correctly a theme and to check that BP is showing properly on it.

    Once done, you can eventually customize the theme. But only if it doesn’t fit exactly with a event plugin. For the messages, if BP is ok, messages will be also ok.

    Foundation first. The house after and the wallpaper at the end of the end !

    Avatar of MrMarkG
    MrMarkG
    Participant

    @mrmarkg

    Hi Dan,

    So I have already got BP up and working. I used BP Default Data and I can have dummy users messaging each other so I’m pretty confident BP works OK.

    I’m now just trying to work out which BP templates/pages I need to style to get the BP page(s) looking like the static WP pages.

    Then I’ll add plugins like Paid Membership Pro or Event Espresso for the paid memberships and event pages. And then more styling probably…

    Does that explain better what I am up to?

    Thanks again,

    Mark

    Avatar of danbp
    danbp
    Moderator

    @danbp

    I already understood what you’re doing … and i know Michelie as i use also that dummy data plugin ! ;-)

    To be clear, BP page’s don’t exist. The one you declare during the install are used for internal purpose only. There’s no real possibility to style them, as they change their content depending of the context of the user navigation.

    The only parts (in fact area fragments: header, footer, sidebar….) applied over the active component pages. You could style those in the bp-legacy folder and those of your theme (if you develop yours) or via a child-theme, if you use a third party theme.
    All this is mostly done through CSS and a few custom function for deeper integration, in case of.

    So good luck with styling !

    Avatar of MrMarkG
    MrMarkG
    Participant

    @mrmarkg

    Understood. I’ve managed to create a blank buddypress.php and I’m putting the various loops on it so they can have their look and feel changed.

    Hopefully I might even have something to show you in a few weeks ;-)

    Mark

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

The topic ‘[Resolved] Editing User "Homepage"’ is closed to new replies.