Pin a post, is there such a component?

David Exodus Posted in General Discussion 5 years ago

My title says it all, is there a component to pin a post on top?

Replies
us Rishi B Replied 5 years ago

the easiest way to do this is the following:

  • write a component that can store a flag for pinned posts. you can either use existing tables like ossn_entities_metadata and ossn_entities or you could modify the ossn_objects table since that holds most post data.
  • make the post add a link to newsfeed posts (see the "dislike" component for an example of how to do this) when the logged in user is an admin. use a function like is_AdminLoggedIn() for ease.
  • modify the OssnWall component to check for this flag and resort the posts with pinned ones at the top.
ch David Exodus Replied 5 years ago

I know that there is a site announcement component. But i wanted to Pin a Blogpost on top.

se Johannes Genberg Replied 5 years ago

Does it even support pictures, links or html?

us Rishi B Replied 5 years ago

you could use the announcement component which is pretty similar: https://www.opensource-socialnetwork.org/component/view/3304/site-announcement