Including custom object subtypes in wall feed?

Tavis Delahunt Posted in Component Development 1 month ago

We've created a new custom post type and are already inserting all the correct entries into the object, entities, and entites_metadata tables, but we're a little unclear about how to have these new custom subtypes appear in the wall feed.

We're trying to add a hook that will include our custom subtype in the feed, but so far it hasn't been working. Can anyone shed some light on the correct $hook and $type we should be using to modify what is included in the wall feed?

Thank you!

Replies
Indonesian Arsalan Shah Replied 1 month ago

Share the code on GitHub so we can understand what you are doing like this is so difficult to understand what your component is about.

You wanted to create a new custom post like polls , events, blog that shows on wall when you added poll, event etc?

Below hook is just to override default wall list paramters only.

us Tavis Delahunt Replied 1 month ago

The other reason we're doing it this way is because we want to be able to override the default wall template for our custom content type.

If there's a different way we should be doing this let me know.

us Tavis Delahunt Replied 1 month ago

Because it's not a wall post any more, we're creating something new based on wall posts but separate from them with additional input fields that the user populates. We got this idea from the Polls Options premium component. They insert their Poll objects into the ossn_object table with the subtype 'poll:item', so we're just mimicking what they did with our own subtype. We are doing this by setting our object's subtype before using addObject.

Is there no way to use a hook to include more than the 'wall' subtype on the wall feed? What if I wanted to restrict what appears on the wall further, and I don't mean to include a different subtype, but lets say I want to filter out certain user's posts for example? How would I write that hook?

Indonesian Arsalan Shah Replied 1 month ago

Changing subtypes make those posts won't appear. Those wall subtype is meant to be only wall nothing else.

Indonesian Arsalan Shah Replied 1 month ago

Ok

How did you you changed wall: subtype when adding wall post?

Why you wanted to change it? As more explanation would ve helpful.

us Tavis Delahunt Replied 1 month ago

No, we haven't modified the table structure whatsoever.

Let me ask this a different way, the GetPosts() function in OssnWall sets the subtype in $defaults to 'wall'. We're trying to write a hook that can include our own subtype into $params. We're just not sure how to reference that function in a hook. We were trying ossnaddhook('wall', 'GetPosts', 'ourcustomwall_function'); but that doesn't seem to do anything.

Indonesian Arsalan Shah Replied 1 month ago

What i meant was did you edited database and added new column?

us Tavis Delahunt Replied 1 month ago

With a custom component. We're not doing it any differently from how wall posts are created, we're just using our own own subtype in ossn_object instead of 'wall'. Everything else is done exactly the same as it normally would be to make a wall post.

All we're actually trying to understand is how to modify what is included in the wall feed so that our custom subtype is included.

Indonesian Arsalan Shah Replied 1 month ago

How did you created custom post type? Please explain