Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding xprofile data to the Activity Stream

  • @majecdad

    Participant

    I found a very helpful snippet that @danbp had posted for @saxisme — I wanted to take it to that next step as @saxisme had mentioned.

    I wanted to add that xprofile field data to what looks like the “Activity-Header” where currently it displays:

    Username posted an update (or)
    Username replied to the topic… etc…

    I would like to inject the xprofile field created by that snippet so the activity header displays like:

    Username – XPROFILE FIELD posted an update (or)
    Username – XPROFILE FIELD replied to the topic… (etc…)

    Which file should I look to add the <?php do_action( ‘showsaxisme’); ?> that @danbp so kindly shared to accomplish this?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • @shanebp

    Moderator

    As it says in that thread – to entry.php
    Specifically buddypress\bp-templates\bp-legacy\buddypress\activity\entry.php

    And of course create a template overload of that file.

    @majecdad

    Participant

    Thanks @shanebp, I did that, but it put the xprofile field info under the avatar (using Line 24). I also tried to add it to line 32, like this:

    <div class="activity-content">
    		
    		<div class="activity-header">
    
    			<?php bp_activity_action(); ?>
    			<?php do_action( 'showsaxisme'); ?>
    		</div>

    but that put it *below* the area I was looking to do (was placed under the activity time stamp).

    If if goes somewhere in that same file, I just don’t see exactly where to inject it so it displays in the place I was looking to do.

    Thanks for any help you can provide.

    @danbp

    Participant

    Try one the other existing action hook in entry.php. If they don’t fit to your need, you add the custom action where you need it.

    Keep also in mind that all position are div, so depending your theme you have also to maipulate CSS to achieve your goal.

    @majecdad

    Participant

    I tried in a number of different places, and while not perfect, I settled for placement just above the activity-header. I also caught the div was there and was able to target it to make styling mods in the theme.

    One of these days I’ll figure out how all this works, but for now trial and error (and error and error and error) 🙂 will have to do.

    Thanks for the help guys. Have a great day.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding xprofile data to the Activity Stream’ is closed to new replies.
Skip to toolbar