Skip to:
Content
Pages
Categories
Search
Top
Bottom

Switch between blog post, forum post, and custom post type from “What’s New”


  • Brendan
    Participant

    @thirty3

    Hey gang,

    I’m looking to build a switchable “What’s New” input box.

    Basically, I need to be able select from three options:
    Blog Post (Custom post type)
    Question and Answer (Forum Post, to specific Q/A Forum)
    A Tip (Another Custom Post Type)

    I’m thinking three buttons above or below the “What’s New” field that switches where the “What’s New” Field posts to.

    Using WordPress 4.9.5 and Buddypress 2.9.4, building a custom theme.

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

  • Venutius
    Moderator

    @venutius

    I’m uncertain as to your described use case, the What’s New input is for activity, not forum posts or CPT’s, could you describe further how you see this working?


    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?


    Venutius
    Moderator

    @venutius

    It’s true blog posts content and also forum post content can be displayed in the activity stream, but a What’s New activity update can’t create a post. Though I’m thinking what you are after is a variable structure What’s New input form, with the ability to tag each activity update as one of your categories, with the ability to change the format of the activity update depending on the category it’s going to be posted as.

    I think that would take quite a bit of work, you’d probably need to overload the page that creates the What’s new section on the page and add Javascript to hide parts of that section depending on the button clicked. You’d also need to change the basic text input form to an editor with a lot of features – swap it out for the wp_editor input field so you get editor buttons and also the ability to add images.

    I’m not aware of any plugins that come close to providing that kind of functionality, it’s all doable of course, but I think quite a bit of effort would be required.


    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

    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?


    Venutius
    Moderator

    @venutius

    You would need to take the plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/post-form.php file and put it in themes/child-theme/buddypresss/activity/post-form.php.

    This is used to create the What’s New form in the Activity, profile/activity and group/activity pages.


    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 ?


    Venutius
    Moderator

    @venutius

    Yep you can build it into your theme direct


    Venutius
    Moderator

    @venutius

    This link here describes swapping out the What’s New testarea for a rich text editor, it might give you some ideas.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Skip to toolbar