Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • Brendan
    Participant

    @thirty3

    OK thank you. Consider this resolved. I have a plugin that’s interfering with that redirect. The plugin is temporary and when I go live it wont be a problem. Thanks!


    Brendan
    Participant

    @thirty3

    I’ll give another example, since this appears to me to be a bug.
    Buddypress requires pretty permalinks, so why is my permalink a ?p=123 type??
    Here’s the code I’m using to add a custom post type to my activity feed.

    add_post_type_support( 'community-story', 'buddypress-activity' );
     
    function customize_page_tracking_args() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
     
        bp_activity_set_post_type_tracking_args( 'community-story', array(
            'component_id'             => 'activity',
            'action_id'                => 'new_community-story',
            'bp_activity_admin_filter' => __( 'Shared a new story', 'buddypress' ),
            'bp_activity_front_filter' => __( 'Community Story', 'buddypress' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s shared a new <a href="%2$s">Community Story</a>', 'buddypress' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">Community Story</a>, on the site %3$s', 'buddypress' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'init', 'customize_page_tracking_args', 1000 );
    function record_cpt_activity_content( $cpt ) {
     
        if ( 'new_community-story' === $cpt['type'] ) {
         
            $cpt['content'] = '&nbsp;';
        }
         
     
        return $cpt;
    }
    add_filter('bp_before_activity_add_parse_args', 'record_cpt_activity_content');

    And here’s the result

    
    <p>
    <a href="https://domain.online/members/thirty3/">UserName/a> shared a new <a href="https://domain.online/?p=313">Community Story</a>
    
    <a href="https://domain.online/?p=313" class="view activity-time-since bp-tooltip" data-bp-tooltip="View Discussion"><span class="time-since" data-livestamp="2018-04-23T20:07:18+0000">17 minutes ago</span></a>
    </p>

    Brendan
    Participant

    @thirty3

    That doesn’t seem to be the case. I wonder if it’s a bug since they are custom-post-types or if I just had some redundant code somewhere. I’ve got it working now though with a different method.


    Brendan
    Participant

    @thirty3

    I just followed that link. and I have it working but the permalink is still the simple type, p=123 not the pretty type. which causes the link to break.


    Brendan
    Participant

    @thirty3

    The code for rewriting the feed text is

    bp_activity_new_post'     => __( '%1$s shared a new <a href="%2$s">Story</a>', 'immersecommunity' ),
    bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">Story</a>, on the site %3$s', 'immersecommunity' ),

    which is part of the register_post_type('community-story') function (and mirrored in the 'community-tip' post type.)

    I’m not sure what %2$s should be changed to


    Brendan
    Participant

    @thirty3

    Thanks for the reply!

    The code that enables the tracking is:

    add_post_type_support( 'community-story', 'buddypress-activity' );
    add_post_type_support( 'community-tip', 'buddypress-activity' );

    in bp-custom.php


    Brendan
    Participant

    @thirty3

    Thank you! Since I’m building a bespoke custom theme from scratch, I can skip the /child-theme/ folder, correct? and just make it buddypress/activity/post-form.php ?


    Brendan
    Participant

    @thirty3

    At the very least, what is the buddypress file called that I should edit? and where is it located, and where should I put it in the child theme /buddypress folder?


    Brendan
    Participant

    @thirty3

    That sounds like what I want to be able to do. I’d prefer to use CSS if possible over JS but either way is fine.

    I’m thinking It will take modifying that buddypress template(?) as a child in my theme directory. I’m prepared to do the work, but I’m still learning how buddypress works, and I’m unsure where to start exactly.


    Brendan
    Participant

    @thirty3

    Sure thing. I want to be able to have users post in those three post-types because of how they function. A blog post (custom post type) is suited for a story, a longer-form thing. A forum post is great for Q/A, and a “Tutor Tip” for example sits somewhere between a blog post and a simple status update, so I’m thinking about a second custom post type.

    The main UX design choice for this is to have all of those options in one place, rather than sub-pages or sub-menus, etc.

    It’s also easy for our moderators to be able to “feature” a blog post.

    With buddypress, it’s my understanding that blog posts (with plugins like buddyblock, etc) show up in the activity feed, forum posts can be told to show up in the activity feed.

    My thought is either to have three fields(Story, Question, Tip) , which have buttons that toggle their respective visibility.

    Or

    Have the one field, and the buttons change the destination on submit to one of the three.

    Does that help?

Viewing 10 replies - 1 through 10 (of 10 total)
Skip to toolbar