Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start post types page #119

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Start post types page #119

wants to merge 1 commit into from

Conversation

askvortsov1
Copy link
Sponsor Member

A start to the post types documentation page. As a next step, I'd like to walk the readers through an example, but am unsure of what a good example would be. Perhaps just DiscussionRenamed?

Copy link
Member

@clarkwinkelmann clarkwinkelmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some thoughts:

The only post type available by default is the "Discussion Renamed" event post

I think we should list core extension's classes together with core if we list them in the documentation, with a note that it only exists with extension X.

  • A database representation of the custom post type
  • An Eloquent model to represent the custom post type.

Isn't it basically the same thing?

By default, event posts are stored in the posts database table

I don't think there is any other way? post types are a way to change how a post record is rendered, but there is no way to store them any other way. the "by default" doesn't make sense then.


Regarding the "store as much as possible data" part, I think it's important to note that by default, the whole payload is public. So storing more in preparation for future work might require some good thinking and planning, let's not encourage developers to inject a lot of data in somewhere public but not visible to untrained users.


Regarding post types, I think it's important to mention the concept of EVENT posts. Basically the base post just has a TEXT content that doesn't mean anything. COMMENT posts use that content to store TextFormatter-formatted XML. EVENT posts use that field as a JSON object and are a convenient abstract class for simple event posts like Flarum uses https://github.com/flarum/core/blob/master/src/Post/AbstractEventPost.php . But extensions are free to extend either AbstractEventPost, Post, or technically even CommentPost (but that wouldn't be advisable while we are in beta)

@askvortsov1 askvortsov1 marked this pull request as draft August 28, 2020 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants